Windows 10上的npm安装失败(node-gyp rebuild)

我正在尝试为使用nodejs和node-gyp的克隆项目执行npm安装。 经历了很多版本不匹配问题(特别是使用Visual Studio),并得到了重buildnode-gyp重build失败的一个点。

安装了Python 2.7,卸载了VS2013,并在Visual C ++ 2015中安装了VS2015社区版。使用SET GYP_MSVS_VERSION=2015将环境variablesGYP_MSVS_VERSION更改为SET GYP_MSVS_VERSION=2015npm config set msvs_version 2015 --global ,运行npm install -g --msvs_version=2015和得到以下错误。 在这一点上我没有做任何进一步的调整,并且已经尝试了5个小时以上!

我正在使用Cmder(以pipe理员身份运行),npm v3.6.0,节点v5.7.0和node-gyp v3.3.1(在v3.3.1运行node-gyp -v v3.3.1 node-gyp -v结果)。

我在Windows 10 x64上。

任何人有任何想法是什么导致这些错误?

 ..\src\WebWorkerThreads.cc(231): error C2660: 'v8::Isolate::New': function does not take 0 arguments [C:\Users \ramtin\AppData\Roaming\npm\node_modules\troop-node-enforcer\node_modules\webworker-threads\build\WebWorkerThr eads.vcxproj] ..\src\WebWorkerThreads.cc(540): warning C4996: 'node::FatalException': was declared deprecated [C:\Users\ramt in\AppData\Roaming\npm\node_modules\troop-node-enforcer\node_modules\webworker-threads\build\WebWorkerThreads. vcxproj] C:\Users\ramtin\.node-gyp\5.7.0\include\node\node.h(282): note: see declaration of 'node::FatalException' gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23) gyp ERR! stack at emitTwo (events.js:100:13) gyp ERR! stack at ChildProcess.emit (events.js:185:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Windows_NT 10.0.10586 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\ramtin\AppData\Roaming\npm\node_modules\troop-node-enforcer\node_modules\webworker-threads gyp ERR! node -v v5.7.0 gyp ERR! node-gyp -v v3.2.1 gyp ERR! not ok C:\Users\ramtin\AppData\Roaming\npm `-- (empty) npm WARN optional Skipping failed optional dependency /troop-node-enforcer/chokidar/fsevents: npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.8 npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "--msvs_version=2015" npm ERR! node v5.7.0 npm ERR! npm v3.6.0 npm ERR! code ELIFECYCLE npm ERR! webworker-threads@0.5.7 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the webworker-threads@0.5.7 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 webworker-threads 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 webworker-threads npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls webworker-threads npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! C:\Users\ramtin\trooptraining\troop\troop-node-enforcer\npm-debug.log npm ERR! code 1 

问题是正在安装的troop-node-enforcer器的版本取决于旧版本的webworker-threads模块,它是过时的。 npm日志显示它正在安装v0.5.7,而最新版本是v0.7.1,并且自早期版本以来已经有很多修复。