RunJS icon indicating copy to clipboard operation
RunJS copied to clipboard

Package `sharp` gets installed but fails to run

Open kapooostin opened this issue 1 year ago • 10 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)",
        ""
      ]
    }
  ]
}

kapooostin avatar Apr 05 '24 13:04 kapooostin

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.

lukehaas avatar Apr 05 '24 13:04 lukehaas

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

kapooostin avatar Apr 06 '24 17:04 kapooostin

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

btecu avatar Apr 26 '24 21:04 btecu

@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.

lukehaas avatar Apr 27 '24 10:04 lukehaas

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

lukehaas avatar Apr 27 '24 10:04 lukehaas

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

kapooostin avatar Apr 30 '24 17:04 kapooostin

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

lukehaas avatar Apr 30 '24 17:04 lukehaas

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

kapooostin avatar Apr 30 '24 17:04 kapooostin

Installing sharp manually makes it work, indeed.

kapooostin avatar Apr 30 '24 17:04 kapooostin

@kapooostin @btecu this seems to be working ok now in the latest release.

lukehaas avatar Oct 16 '24 10:10 lukehaas

@kapooostin @btecu this seems to be working ok now in the latest release.

Yep, it works great, thank you!

kapooostin avatar Oct 31 '24 14:10 kapooostin