Cannot install Nuxt Image module with Deno package manager
Environment
"dependencies": {
"@nuxt/fonts": "0.11.4",
"@nuxt/icon": "1.13.0",
"@nuxt/image": "1.10.0",
"@tailwindcss/vite": "^4.1.7",
"nuxt": "^3.17.3",
"tailwindcss": "^4.1.7",
"vue": "^3.5.14",
"vue-router": "^4.5.1"
},
"devDependencies": {
"typescript": "^5.8.3"
}
Deno version:
Reproduction
https://github.com/devniza/deno-nuxt-image-error-repro
Describe the bug
Similar to the issue raised in the Nuxt repo: https://github.com/nuxt/image/issues/1691
Deno is supported now by Nuxt and shown as an option as your package manager for new Nuxt Projects initiated via CLI.
This is the error message on deno install:
Warning The following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed:
...
┠─ npm:[email protected]
...
> deno install --allow-scripts=npm:@tailwindcss/[email protected],npm:[email protected],npm:@parcel/[email protected]
error: script 'install' in '[email protected]' failed with exit code 1
stdout:
sharp: Using cached C:\Users\nizas\AppData\Roaming\npm-cache\_libvips\libvips-8.14.5-win32-x64.tar.br
sharp: Integrity check passed for win32-x64
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
stderr:
sharp: Installation error: Unexpected end of data
Error launching 'node-gyp': program not found
error: failed to run scripts for packages: [email protected]
I have already installed node-gyp
> node-gyp
Usage: node-gyp <command> [options]
where <command> is one of:
- build - Invokes `msbuild` and builds the module
- clean - Removes any generated build files and the "out" dir
- configure - Generates MSVC project files for the current module
- rebuild - Runs "clean", "configure" and "build" all at once
- install - Install node development files for the specified node version.
- list - Prints a listing of the currently installed node development files
- remove - Removes the node development files for the specified version
[email protected] C:\Users\nizas\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\node-gyp
[email protected]
Additional context
No response
Logs
{
"error": {
"message": "[500] [IPX_ERROR] \nSomething went wrong installing the \"sharp\" module\n\nCannot find module '../build/Release/sharp-win32-x64.node'\nRequire stack:\n- C:\\Users\\nizas\\Desktop\\deno-nuxt-image-error-repro\\node_modules\\.deno\\[email protected]\\node_modules\\sharp\\lib\\sharp.js\n- C:\\Users\\nizas\\Desktop\\deno-nuxt-image-error-repro\\node_modules\\.deno\\[email protected]\\node_modules\\sharp\\lib\\constructor.js\n- C:\\Users\\nizas\\Desktop\\deno-nuxt-image-error-repro\\node_modules\\.deno\\[email protected]\\node_modules\\sharp\\lib\\index.js\n- C:\\Users\\nizas\\Desktop\\deno-nuxt-image-error-repro\\node_modules\\.deno\\[email protected]\\node_modules\\sharp\\lib\\index.js\n\nPossible solutions:\n- Install with verbose logging and look for errors: \"npm install --ignore-scripts=false --foreground-scripts --verbose sharp\"\n- Install for the current win32-x64 runtime: \"npm install --platform=win32 --arch=x64 sharp\"\n- Consult the installation documentation: https://sharp.pixelplumbing.com/install"
}
}
I've tried to install node-gyp using deno instead of pnpm:
> node-gyp
Usage: node-gyp <command> [options]
where <command> is one of:
- build - Invokes `msbuild` and builds the module
- clean - Removes any generated build files and the "out" dir
- configure - Generates MSVC project files for the current module
- rebuild - Runs "clean", "configure" and "build" all at once
- install - Install node development files for the specified node version.
- list - Prints a listing of the currently installed node development files
- remove - Removes the node development files for the specified version
[email protected] C:\Users\nizas\AppData\Local\deno\npm\registry.npmjs.org\node-gyp\11.2.0
[email protected]
Still getting this error:
deno install --allow-scripts=npm:@tailwindcss/[email protected],npm:[email protected],npm:@parcel/[email protected]
Warning The following packages are deprecated:
┠─ npm:[email protected] (Glob versions prior to v9 are no longer supported)
┠─ npm:[email protected] (This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.)
┠─ npm:[email protected] (Glob versions prior to v9 are no longer supported)
┠─ npm:@types/[email protected] (This is a stub types definition. parse-path provides its own type definitions, so you do not need this installed.)
┠─ npm:[email protected] (This package is no longer supported.)
┠─ npm:[email protected] (Rimraf versions prior to v4 are no longer supported)
┠─ npm:[email protected] (This package is no longer supported.)
┠─ npm:[email protected] (This package is no longer supported.)
┖─ npm:[email protected] (Use your platform's native DOMException instead)
error: script 'install' in '[email protected]' failed with exit code 1
stdout:
sharp: Using cached C:\Users\nizas\AppData\Roaming\npm-cache\_libvips\libvips-8.14.5-win32-x64.tar.br
sharp: Integrity check passed for win32-x64
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
stderr:
sharp: Installation error: Unexpected end of data
Error launching 'node-gyp': program not found
error: failed to run scripts for packages: [email protected]
EDIT 1 I am going to try to install node-gyp inside my project instead of globally.
EDIT 2 I added sharp and node-gyp inside my personal project and I got this error
error: script 'install' in '[email protected]' failed with exit code 6
stdout:
sharp: Using cached C:\Users\nizas\AppData\Roaming\npm-cache\_libvips\libvips-8.14.5-win32-x64.tar.br
sharp: Integrity check passed for win32-x64
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
stderr:
sharp: Installation error: Unexpected end of data
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.13.3 found at "C:\Users\nizas\scoop\apps\python\current\python.exe"
gyp http GET https://nodejs.org/download/release/v22.14.0/node-v22.14.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v22.14.0/node-v22.14.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v22.14.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v22.14.0/win-x64/node.lib
gyp ERR! Completion callback never invoked!
gyp ERR! System Windows_NT 10.0.22631
gyp ERR! command "node-gyp" "C:\\Users\\nizas\\Documents\\Projects\\niza-template\\node_modules\\.deno\\[email protected]\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\nizas\Documents\Projects\niza-template\node_modules\.deno\[email protected]\node_modules\sharp
gyp ERR! node -v v22.14.0
gyp ERR! node-gyp -v v11.2.0
gyp ERR! Node-gyp failed to build your package.
gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
error: script 'install' in '@parcel/[email protected]' failed with exit code 143
error: script 'postinstall' in '@tailwindcss/[email protected]' failed with exit code 143
error: failed to run scripts for packages: [email protected], @parcel/[email protected], @tailwindcss/[email protected]
I decided to install node version 22.14.0 and set it as my default using nvm.
I then ran the command:
deno install --allow-scripts=npm:@parcel/[email protected],npm:@tailwindcss/[email protected],npm:[email protected]
I made sure the following were found in my package.json:
"node-gyp": "^11.2.0",
"sharp": "0.32.6",
I also globally installed node-gyp using deno install. (I don't know if this has an effect or not but I did so to make sure).
deno install --allow-scripts --allow-sys --allow-env --allow-read npm:node-gyp
I installed Visual Studio Desktop Development with C++ Tools, just incase.
I set my deno.json file to use manual:
{
"nodeModulesDir": "manual"
}
And (just in case) I ran the command to make sure deno used manual mode:
deno run -A --node-modules-dir=manual dev
So far no errors have been formed.
However, the error still persists in the browser console:
{
"error": {
"message": "[500] [IPX_ERROR] \nSomething went wrong installing the \"sharp\" module\n\nLoadLibraryExW failed\n\nPossible solutions:\n- Install with verbose logging and look for errors: \"npm install --ignore-scripts=false --foreground-scripts --verbose sharp\"\n- Install for the current win32-x64 runtime: \"npm install --platform=win32 --arch=x64 sharp\"\n- Consult the installation documentation: https://sharp.pixelplumbing.com/install"
}
}