-
Notifications
You must be signed in to change notification settings - Fork 511
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
Unable to install with command failed sh -c node-gyp rebuild #2123
Comments
Maybe unrelated, but I experiencing a node-gyp issue in Windows. VersionsC:\www-docker>node -v
v21.6.1
C:\www-docker>npm -v
10.4.0
C:\www-docker>python3 --version
Python 3.12.1
Python 3.11.7 (same error with both version)
C:\www-docker>npm list -g --depth=0
c:\Program Files\nodejs -> .\
+-- corepack@0.24.1
+-- node-gyp@10.0.1
`-- npm@10.4.0 Latest Visual Studio Community 2022 is installed with desktop C++ built tools. Error messageC:\www-docker>npx nuxi@latest init nuxt-example
✔ Which package manager would you like to use?
npm
◐ Installing dependencies... 22:03:30
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup [
npm WARN cleanup 'C:\\www-docker\\nuxt-example\\node_modules\\@nuxt',
npm WARN cleanup [Error: EPERM: operation not permitted, rmdir 'C:\www-docker\nuxt-example\node_modules\@nuxt\devtools\dist\client'] {
npm WARN cleanup errno: -4048,
npm WARN cleanup code: 'EPERM',
npm WARN cleanup syscall: 'rmdir',
npm WARN cleanup path: 'C:\\www-docker\\nuxt-example\\node_modules\\@nuxt\\devtools\\dist\\client'
npm WARN cleanup }
npm WARN cleanup ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\www-docker\nuxt-example\node_modules\@parcel\watcher
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@21.6.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.11.7 found at "C:\Users\User\.pyenv\pyenv-win\versions\3.11.7\python3.exe"
npm ERR! gyp info find VS using VS2022 (17.8.34525.116) found at:
npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\User\.pyenv\pyenv-win\versions\3.11.7\python3.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\www-docker\\nuxt-example\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\www-docker\\nuxt-example\\node_modules\\@parcel\\watcher\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\www-docker\\nuxt-example\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\21.6.1\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\21.6.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\www-docker\\nuxt-example\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\21.6.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\www-docker\\nuxt-example\\node_modules\\@parcel\\watcher',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\www-docker\\nuxt-example\\node_modules\\@parcel\\watcher\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: binding.gyp not found (cwd: C:\www-docker\nuxt-example\node_modules\@parcel\watcher) while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (C:\www-docker\nuxt-example\node_modules\node-gyp\lib\configure.js:271:18)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:519:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22631
npm ERR! gyp ERR! command "c:\\program files\\nodejs\\node.exe" "C:\\www-docker\\nuxt-example\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\www-docker\nuxt-example\node_modules\@parcel\watcher
npm ERR! gyp ERR! node -v v21.6.1
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: C:\Users\User\AppData\Local\npm-cache\_logs\2024-02-02T21_03_31_154Z-debug-0.log
ERROR Error: Command failed with exit code 1: npm install |
@DJviolin the error stack looks almost identical. Thanks for sharing, I was thinking with might have been only a macOS issue because I couldn't reproduce it using services like StackBlitz. If you add the following to
|
Thank You, your solution works! I tested both with an official example and in my local project in Windows. Interestingly, in WSL Docker it works without the package override. I tried all newest versions from "@parcel/watcher" and v2.1.0 the last one that works. |
Solution with add
before choose a package manager, works great! |
Please try |
Thanks Devon! Closing here |
Environment
Reproduction
Run the following commands:
npx giget@latest nitro nitro-app
cd nitro-app
npm install
Describe the bug
The install fails because it seems like there might be some issue with a
nitropack
dependency on@parcel/watcher
. Specifically this is only happening with version 2.20 and greater of that dependency, 2.1.0 works as expected.Additional context
Everything was working fine for me until today when I did a clean install (
rm package-lock.json && rm -rf node_modules && npm install
). The only way to fix the issue for me is to override the@parcel/watcher
version as follows:'When I run
npm ls @parcel/watcher
it seems to show that dependency is coming from anitropack
dependency:This seems to also be an issue that has been reported here parcel-bundler/watcher#156 and parcel-bundler/watcher#153 as well with other Nuxt users experiencing the same issue.
I also opened nuxt/nuxt#25478 for the same thing but was directed here.
Logs
The text was updated successfully, but these errors were encountered: