gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 22:31:45 26 4
gpt4 key购买 nike

我正在尝试为使用nodejs和node-gyp的克隆项目进行npm安装。遇到了很多版本不匹配问题(尤其是 Visual Studio),并且达到了重建时 Node-gyp 重建失败的地步。

安装了Python 2.7,卸载了VS2013并使用Visual C++ 2015安装了VS2015社区版。更改了环境变量GYP_MSVS_VERSION2015使用SET GYP_MSVS_VERSION=2015 ,做了npm config set msvs_version 2015 --global ,跑npm install -g --msvs_version=2015并得到以下错误。此时我没有做任何事情来进一步推进该过程,并且已经尝试了 5 个多小时!

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

我使用的是 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,并且自旧版本以来已经进行了许多修复。

关于node.js - npm 安装在 Windows 10 上失败(node-gyp 重建),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36096746/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com