我正在尝试在Windows 8上的Node.js项目中执行以下命令:
npm install web3@1.0.0-beta.24
但是我有一个错误,我有节点想法如何处理。
TRACKER:错误TRK0005:找不到:“CL.exe”。系统不能 找到指定的文件。 [C:\项目\ myproject的\ node_modules \ scrypt \建立\ copied_files.vcxproj]
以下是整个输出:
scrypt@6.0.3预安装C:\ Projects \ myproject \ node_modules \ scrypt node node-scrypt-preinstall.js
scrypt@6.0.3安装C:\ Projects \ myproject \ node_modules \ scrypt node-gyp rebuild
C:\ Projects \ myproject \ node_modules \ scrypt>如果未定义 npm_config_node_gyp(节点“C:\ Program 文件\的NodeJS \ node_modules \故宫\ BIN \节点GYP斌\ .... \ node_modules \节点GYP \ BIN \节点-G yp.js“rebuild”else(节点“”rebuild)警告:缺少输入 files:C:\ Projects \ myproject \ node_modules \ scrypt \ build .. \ scrypt \ win \ include \ config.h 一次一个地在此解决方案中构建项目。启用 并行构建,请添加“/ m”开关。 C:\ Program Files (86)\的MSBuild \ Microsoft.Cpp \ V4.0 \ V140 \ Microsoft.CppBuild.targets(366,5): 警告MSB8003:无法从中找到WindowsSDKDir变量 注册表中。 TargetFrameworkVersion或PlatformToolset可以设置为 版本号无效。 [C:\ Projects \ myproject \ node_modules \ scrypt \ build \ copied_files.vcxproj]复制 scrypt / win / include / config.h到scrypt / scrypt-1.2.0 / config.h 系统找不到指定的文件。跟踪器:错误TRK0005:失败 找到:“CL.exe”。该系统找不到指定的文件。 [C:\项目\ myproject的\ node_modules \ scrypt \建立\ copied_files.vcxproj]
C:\ Program Files (86)\的MSBuild \ Microsoft.Cpp \ V4.0 \ V140 \ Microsoft.CppBuild.targets(366,5): 警告MSB8003:无法从中找到WindowsSDKDir变量 注册表中。 TargetFrameworkVersion或PlatformToolset可以设置为 版本号无效。 [C:\ Projects \ myproject \ node_modules \ scrypt \ build \ scrypt_wrapper.vcxproj] TRACKER: 错误TRK0005:找不到:“CL.exe”。系统找不到了 文件指定。 [C:\项目\ myproject的\ node_modules \ scrypt \建立\ scrypt_wrapper.vcxproj]
gyp ERR!构建错误gyp ERR!堆栈错误:
C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
失败,退出代码:1 gyp ERR! 在ChildProcess.onExit堆栈(C:\ Program 文件\的NodeJS \ node_modules \故宫\ node_modules \节点GYP \ LIB \ build.js:258:23) gyp ERR!堆栈在emitTwo(events.js:126:13)gyp ERR!堆栈在 ChildProcess.emit(events.js:214:7)gyp ERR!堆栈在 Process.ChildProcess._handle.onexit(internal / child_process.js:198:12) gyp ERR!系统Windows_NT 6.2.9200 gyp ERR!命令“C:\ Program Files \ nodejs \ node.exe“”C:\ Program 文件\的NodeJS \ node_modules \故宫\ node_modules \节点GYP \ BIN \节点gyp.js” “重建”gyp ERR! cwd C:\ Projects \ myproject \ node_modules \ scrypt gyp ERR! node -v v8.9.1 gyp ERR!节点GYP -v v3.6.2 gyp ERR!不行npm WARN inbanner@1.6.0没有存储库字段。npm ERR!代码ELIFECYCLE npm ERR!错误1 npm ERR! scrypt@6.0.3 安装:
node-gyp rebuild
npm ERR!退出状态1 npm ERR!错误的ERR! scrypt@6.0.3安装脚本失败。错误的ERR!这可能是 不是npm的问题。可能有额外的日志输出 上方。npm ERR!可以在以下位置找到此运行的完整日志:npm ERR!
C:\用户\用户\应用程序数据\漫游\ NPM-cache_logs \ 2017-11-13T01_31_12_133Z-的debug.log
帮助!
答案 0 :(得分:3)
这个包似乎需要本机编译。您需要为此安装Visual Studio C ++构建工具。您可以从以下链接下载相同的内容
http://landinghub.visualstudio.com/visual-cpp-build-tools
此后,您需要确保路径中有CL.exe
。它将在C:\Program Files\Microsoft Visual Studio 10.0\VC\ce\bin
之类的路径上。这将根据您安装的构建工具的版本而更改。
如果安装程序没有为您执行此操作,则需要确保更新Windows PATH环境变量。
此外,如果npm仍然失败,您可以尝试使用yarn
yarn add web3@1.0.0-beta.24
答案 1 :(得分:2)
ERR!在scrypt@6.0.3安装脚本中失败。
错误是由scrypt
包引起的,因为node-gyp
无法重建,
尝试以管理员身份运行 cmd 并运行npm install scrypt@6.0.3
,如果无效,请尝试node-gyp rebuild
或reinstall it
如果您使用node-gyp修复了问题,则在安装Cl.exe
node-gyp
答案 2 :(得分:0)
我在同一条船上,在线发现的大部分答案对于此重建错误无法帮助(或者不是100%可行)。在尝试了几种不同的方法后,我发现这种方式适用于我的机器(Windows 10 Pro)。现在,我能够毫无问题地安装web3。 (或其他与node-gyp问题相关的包,例如"松露unbox反应")
我总结的步骤如下:
打开Visual Studio 2015并创建"新项目......"
通过npm命令安装/链接python
npm --add-python-to-path="true" --debug install --global windows-build-tools
npm config set msvs_version 2015 --global
npm install web3
供参考: 我的npm版本:5.6.0 我的节点版本:8.9.4
希望这会有所帮助!