lukehaas/RunJS

Package `sharp` gets installed but fails to run

Opened this issue · 9 comments

I installed sharp package. But it cannot be loaded:

Error: Could not load the "sharp" module using the darwin-x64 runtime

Is there any way to use it in RunJS?

My log is below

{
  "version": "2.11.0",
  "platform": "darwin",
  "arch": "x64",
  "activated": true,
  "logs": [
    {
      "path": "/Users/USER/Library/Logs/runjs/main.log",
      "lines": [
        "[2024-03-12 17:07:06.694] [warn]  sysctl shell command to check for macOS Rosetta environment failed: Error: Command failed: sysctl sysctl.proc_translated",
        "sysctl: unknown oid 'sysctl.proc_translated'",
        "",
        "[2024-03-13 22:23:44.537] [warn]  sysctl shell command to check for macOS Rosetta environment failed: Error: Command failed: sysctl sysctl.proc_translated",
        "sysctl: unknown oid 'sysctl.proc_translated'",
        "",
        "[2024-04-05 15:07:44.062] [error] Unhandled TypeError: Cannot read properties of undefined (reading 'libraryDefaultDir')",
        "    at Function.resolvePathFn (/Applications/RunJS.app/Contents/Resources/app.asar/entry-bundle.js:14:97807)",
        "    at Function.readAllLogs (/Applications/RunJS.app/Contents/Resources/app.asar/entry-bundle.js:14:97314)",
        "    at click (/Applications/RunJS.app/Contents/Resources/app.asar/entry-bundle.js:8:90678)",
        "    at MenuItem.click (node:electron/js2c/browser_init:2:29559)",
        "    at a._executeCommand (node:electron/js2c/browser_init:2:34987)",
        ""
      ]
    }
  ]
}

Thanks, @kapooostin. I've just had a look, and I'm seeing the same thing in the current version of RunJS.
However, it is working in the latest release candidate which will be released as RunJS version 2.12.0 at some point within the next few weeks.

Great! Is there a way to install RC-version beforehand?

Seems like this might still be an issue in latest version.

@btecu interesting, you're right. It looks like it only works for me when I'm running in dev mode, not prod.
Sorry, @kapooostin, I will need to look into this further.

@kapooostin for the moment, you could try manually installing it in this directory: ~/Library/Application\ Support/runjs

@lukehaas I'd love to, Sorry, how exactly could I do it?

If you're on mac, navigate to ~/Library/Application\ Support/runjs in your terminal and then run npm install sharp.

I updated RunJS and now it loads sharp. But cannot use it
image
WIll try to install it manually, sec...

Installing sharp manually makes it work, indeed.