-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimental npm support did not resolve the node dependencies (sharp, util) #16277
Labels
Comments
Related issue lovell/sharp#2583 |
I'm still fighting Sharp installation as well. ➜ deno task dev
Task dev deno run ./src/app.ts
✅ Granted all read access.
✅ Granted all env access.
error: Uncaught (in promise) Error:
Something went wrong installing the "sharp" module
Cannot find module '../build/Release/sharp-darwin-arm64v8.node'
Require stack:
- /Users/admin/repos/node_modules/.deno/[email protected]/node_modules/sharp/lib/sharp.js
- /Users/admin/repos/node_modules/.deno/[email protected]/node_modules/sharp/lib/constructor.js
- /Users/admin/repos/node_modules/.deno/[email protected]/node_modules/sharp/lib/index.js
- /Users/admin/repos/node_modules/.deno/[email protected]/node_modules/join-images/lib/main.js
- /Users/admin/repos/node_modules/.deno/[email protected]/node_modules/join-images/lib/main.js
Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current darwin-arm64v8 runtime: "npm install --platform=darwin --arch=arm64v8 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
at Object.<anonymous> (file:///Users/admin/repos/node_modules/.deno/[email protected]/node_modules/sharp/lib/sharp.js:37:9)
at Object.<anonymous> (file:///Users/admin/repos/node_modules/.deno/[email protected]/node_modules/sharp/lib/sharp.js:40:4)
at Module._compile (node:module:745:34)
at loadMaybeCjs (node:module:770:10)
at Object.Module._extensions..js (node:module:755:12)
at Module.load (node:module:662:32)
at Function.Module._load (node:module:534:12)
at Module.require (node:module:681:19)
at require (node:module:812:16)
at Object.<anonymous> (file:///Users/admin/repos/node_modules/.deno/[email protected]/node_modules/sharp/lib/constructor.js:11:1)
info: Trying to execute an npm package using Node-API addons,
these packages require local `node_modules` directory to be present.
hint: Add `"nodeModulesDir": "auto" option to `deno.json`, and then run
`deno install --allow-scripts=npm:<package> --entrypoint <script>` to setup `node_modules` directory. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Env
Run the code:
import sharp from 'npm:sharp';
And throw exception:
Then find the keyword in the sharp package:
Expected
Resolve the node dependencies.
Additional Info
If I remove the util line, there is the same error with the stream package:
error: Uncaught (in promise) Error: Cannot find module 'stream'
Also, the following alternative is not working:
import sharp from "https://esm.sh/[email protected]";
with error:
The text was updated successfully, but these errors were encountered: