Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

npm install fails when installing VisualStudio 2019 #182

Closed
fuyutsuki opened this issue Apr 6, 2019 · 2 comments
Closed

npm install fails when installing VisualStudio 2019 #182

fuyutsuki opened this issue Apr 6, 2019 · 2 comments

Comments

@fuyutsuki
Copy link

fuyutsuki commented Apr 6, 2019

Hi, I encountered this problem, so propose some problems and solutions.
It would be nice if solution already exists.

Overview

> node-gyp rebuild

D:\Repository\misskey>if not defined npm_config_node_gyp (node "D:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:430:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/next_tick.js:76:17)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Repository\misskey
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! misskey@10.98.3 install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the misskey@10.98.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

As this line shows, windows-build-tools recognizes Visual Studio 2019 and is looking for MSBuild.exe.

gyp ERR! stack Error: spawn D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\15.0\Bin\MSBuild.exe ENOENT

Solution

I think that the easiest and most flexible way is to add an option or environment variable so that we can specify the path to MSBuild.exe.

My environment

  • Win10 1809 Home x64
  • node v11.12.0
    • npm v 6.7.0
      • node-gyp@3.8.0
      • windows-build-tools@5.1.0
  • Visual Studio 2019
@felixrieseberg
Copy link
Owner

Ah, this puts us in a tricky spot. From what I can tell, Node and Visual Studio 2019 don't play nice together just yet (nodejs/node-gyp#1663).

I'm not sure what the best solution is - maybe detect VS2019 and warn?

@fuyutsuki
Copy link
Author

fuyutsuki commented Apr 22, 2019

@felixrieseberg Ahh, until then it will be decided to give up using the VS2019 as it will be fixed over time.

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants