首页 文章

TRACKER:错误TRK0005:找不到:“CL.exe” . 该系统找不到指定的文件

提问于
浏览
9

我正在尝试在Windows 8上的Node.js项目中执行以下命令:

npm install web3@1.0.0-beta.24

但我有一个错误,我有节点想法如何处理 .

TRACKER:错误TRK0005:找不到:“CL.exe” . 该系统找不到指定的文件 . [C:\项目\ myproject的\ node_modules \ scrypt \ Build \ copied_files.vcxproj]

这是整个输出:

scrypt@6.0.3 preinstall C:\ Projects \ myproject \ node_modules \ scrypt node node-scrypt-preinstall.js scrypt@6.0.3 install C:\ Projects \ myproject \ node_modules \ scrypt node-gyp rebuild C:\ Projects \ myproject \ node_modules \ scrypt>如果没有定义npm_config_node_gyp(节点“C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ node-gyp-bin \ .... \ node_modules \ node-gyp \ bin \ node-g yp .js“rebuild”else(节点“”rebuild)警告:缺少输入文件:C:\ Projects \ myproject \ node_modules \ scrypt \ build .. \ scrypt \ win \ include \ config.h在此解决方案中构建一个项目一时间要启用并行构建,请添加“/ m”开关 . C:\ Program Files(x86)\ 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系统找不到指定的文件 . TRACKER:错误TRK0005:找不到:“CL.exe” . 该系统找不到指定的文件 . [C:\ Projects \ myproject \ node_modules \ scrypt \ build \ copied_files.vcxproj] C:\ Program Files(x86)\ 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:\ Projects \ myproject \ node_modules \ scrypt \ build \ scrypt_wrapper.vcxproj] gyp ERR!构建错误gyp ERR!堆栈错误:C:\ Program Files(x86)\ MSBuild \ 14.0 \ bin \ msbuild.exe失败,退出代码:1 gyp ERR!在ChildProcess.onExit堆栈(C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-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 Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp \ bin \ node-gyp.js”“rebuild”gyp ERR! cwd C:\ Projects \ myproject \ node_modules \ scrypt gyp ERR! node -v v8.9.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR!不行npm WARN inbanner@1.6.0没有存储库字段 . 错误的ERR!代码ELIFECYCLE npm ERR!错误1 npm ERR! scrypt@6.0.3 install:node-gyp rebuild npm ERR!退出状态1 npm ERR!错误的ERR! scrypt@6.0.3安装脚本失败 . 错误的ERR!这可能不是npm的问题 . 上面可能有额外的日志记录输出 . 错误的ERR!可以在以下位置找到此运行的完整日志:npm ERR! C:\用户\用户\应用程序数据\漫游\ NPM-cache_logs \ 2017-11-13T01_31_12_133Z-的debug.log

救命!

3 回答

  • 2

    这个包似乎需要本机编译 . 您需要为此安装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
    
  • 0

    错误! scrypt@6.0.3安装脚本失败 .

    该错误是由 scrypt 包引起的,因为 node-gyp 无法重建,

    尝试以管理员身份运行 cmd 并运行 npm install scrypt@6.0.3 ,如果不起作用请尝试 node-gyp rebuildreinstall it

    如果您使用node-gyp解决了问题,那么在安装 node-gyp 的过程中,您应该在正确的位置使用 Cl.exe

  • 2

    我在同一条船上,在线找到的大部分答案都无法帮助(或者不是100%可行)这个重建错误 . 试穿后几种不同的方法,我发现这种方式适用于我的机器(Windows 10 Pro) . 现在,我可以安装web3而没有任何问题 . (或其他与node-gyp问题相关的包,例如“truffle unbox react”)

    我总结的步骤如下:

    • 安装NodeJS,Git

    • 下载Windows Visual Studio 2015

    • 打开Visual Studio 2015并创建“新项目......”

    • 选择"Create new C++ project"

    • 你应该看到一个VS要求安装"Common Tools for Visual C++ 2015"和"Windows 8.1 SDK and Universal CRT SDK"的菜单(这个Windows 8.1 SDK文件中scrypt所需工具中的一些进程)

    • 选择并安装

    • 通过npm命令安装/链接python

    • npm --add-python-to-path="true" --debug install --global windows-build-tools

    • 将msvs_version设置为2015

    • npm config set msvs_version 2015 --global

    • 安装web3

    • npm install web3

    供参考:我的npm版本:5.6.0我的节点版本:8.9.4

    希望这会有所帮助!

相关问题