Skip to content
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

Install npm packages in windows gives node-gyp error #29310

Closed
ghost opened this issue Jun 23, 2017 · 6 comments
Closed

Install npm packages in windows gives node-gyp error #29310

ghost opened this issue Jun 23, 2017 · 6 comments
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@ghost
Copy link

ghost commented Jun 23, 2017

Steps to Reproduce:

  1. .\scripts\npm.bat install
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE

npm ERR! oniguruma@6.1.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oniguruma@6.1.1 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the oniguruma package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs oniguruma
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls oniguruma
npm ERR! There is likely additional logging output above.
@vscodebot vscodebot bot added the bug Issue identified by VS Code Team member as probable bug label Jun 23, 2017
@ghost
Copy link
Author

ghost commented Jun 23, 2017

8 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@0.3.8 (node_modules\fsevents):
36159 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@0.3.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
36160 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
36160 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
36160 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
36160 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
36161 verbose stack Error: oniguruma@6.1.1 install: `node-gyp rebuild`
36161 verbose stack Exit status 1
36161 verbose stack     at EventEmitter.<anonymous> (C:\Users\stefan.schneider\AppData\Local\nvs\node\7.4.0\x64\node_modules\npm\lib\utils\lifecycle.js:279:16)
36161 verbose stack     at emitTwo (events.js:106:13)
36161 verbose stack     at EventEmitter.emit (events.js:191:7)
36161 verbose stack     at ChildProcess.<anonymous> (C:\Users\stefan.schneider\AppData\Local\nvs\node\7.4.0\x64\node_modules\npm\lib\utils\spawn.js:40:14)
36161 verbose stack     at emitTwo (events.js:106:13)
36161 verbose stack     at ChildProcess.emit (events.js:191:7)
36161 verbose stack     at maybeClose (internal/child_process.js:885:16)
36161 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
36162 verbose pkgid oniguruma@6.1.1
36163 verbose cwd D:\repositories\git\vscode
36164 error Windows_NT 10.0.14393

@ghost
Copy link
Author

ghost commented Jun 23, 2017

same for

npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm-debug.txt

@codeguy
Copy link

codeguy commented Jun 25, 2017

Can confirm when attempting to setup local environment for working on a pull request.

@dbaeumer
Copy link
Member

I was able to solve this doing the following:

  • use node 7.4.0
  • git clean -xfd .build (PLEASE note the . in .build)
  • git clean -xfd node_modules
    -git clean -xfd extensions
  • scripts\npm install

@ghost
Copy link
Author

ghost commented Jun 26, 2017

For me it was necessary to also set the npm config set node_gyp manually to the node-gyp.js
And I also had to install with scripts/npm.bat i --msvs_version=2015 since I have more than one installed.

@alexdima alexdima added *question Issue represents a question, should be posted to StackOverflow (VS Code) and removed bug Issue identified by VS Code Team member as probable bug labels Jun 26, 2017
@i-give-up
Copy link

i-give-up commented Sep 12, 2017

I had the same issue (I had VS Express 2008, Build Tools 2015, and Build Tools 2017 installed).

Thanks to con-ssc's post above, I resolved it using

scripts/npm.bat install --msvs_version=2015

alone. I didn't have to perform the npm config set node_gyp step.


To add some background information, here's what I think happened (at least in my case): according to this issue node-gyp doesn't currently support VS 2017 and falls back to VS 2015. However as the Readme for v3.6.2 says

Auto-detection fails for Visual C++ Build Tools 2015

so one would either have to do either one of these

  • npm config set msvs_version 2015 (which I guess is what scripts/npm.bat i --msvs_version=2015 for this single session)
  • node-gyp configure --msvs_version=2015 (not something we can specify directly when building VSCode)

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants