简体   繁体   English

在Windows 10上npm安装失败(node-gyp重建)

[英]npm install fails on Windows 10 (node-gyp rebuild)

I'm trying to do a npm install for a cloned project that uses nodejs and node-gyp. 我正在尝试为使用nodejs和node-gyp的克隆项目进行npm安装。 Experienced a lot of version mismatch issues (especially with Visual Studio) and got to a point where node-gyp rebuild fails on rebuild. 经历了很多版本不匹配的问题(尤其是在Visual Studio中),并达到了节点gyp重建在重建时失败的地步。

Installed Python 2.7, uninstalled VS2013 and installed VS2015 Community edition with Visual C++ 2015. Changed the environment variable GYP_MSVS_VERSION to 2015 using SET GYP_MSVS_VERSION=2015 , did npm config set msvs_version 2015 --global , ran npm install -g --msvs_version=2015 and got the following errors. 安装了Python 2.7,卸载VS2013和安装VS2015社区版与Visual C ++ 2015年改变了环境变量GYP_MSVS_VERSION2015使用SET GYP_MSVS_VERSION=2015 ,确实npm config set msvs_version 2015 --global ,跑到npm install -g --msvs_version=2015和出现以下错误。 Nothing I did moved the process further at this point and have been trying for 5+ hours! 在这一点上,我没有做任何进一步的事情,并且已经尝试了5个多小时!

I'm using Cmder (running as administrator), npm v3.6.0, node v5.7.0 and node-gyp v3.3.1 (running node-gyp -v results in v3.3.1 ). 我正在使用Cmder(以管理员身份运行),npm v3.6.0,node v5.7.0和node-gyp v3.3.1(运行node-gyp -v v3.3.1 node-gyp -vv3.3.1 )。

I'm on Windows 10 x64. 我在Windows 10 x64上。

Anyone has any idea what's causing these errors? 任何人都知道导致这些错误的原因是什么?

..\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

The problem is that the version of troop-node-enforcer being installed is depending on an older version of the webworker-threads module which is outdated. 问题是所安装的troop-node-enforcer器版本取决于过时的webworker-threads模块的较旧版本。 The npm log shows it installing v0.5.7 whereas the newest version is v0.7.1 and has had many fixes since the older version. npm日志显示它已安装v0.5.7,而最新版本为v0.7.1,并且自旧版本以来已进行了许多修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM