节点gyp错误TRACKER:错误TRK0005:找不到:"CL.exe".该系统找不到指定的文件

man*_*nas 76 node.js npm node-gyp

我想在Windows 10机器上使用visual studio community 2015安装bcrypt,安装Python v2.7.3但是我收到以下错误.

节点版本v4.2.1 node-gyp v3.0.3

npm install bcrypt 


C:\Users\ASMIN\Desktop\M2\app>npm install bcrypt
npm WARN package.json eapp@1.0.0 No description
npm WARN package.json eapp@1.0.0 No repository field.
npm WARN package.json eapp@1.0.0 No README data

> bcrypt@0.8.5 install C:\Users\ASMIN\Desktop\M2\app\node_modules\bcrypt
> node-gyp rebuild




 C:\Users\ASMIN\Desktop\M2\app\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node
    -gyp.js" rebuild )  else (node  rebuild )
    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersio
    n or PlatformToolset may be set to an invalid version number. [C:\Users\ASMIN\Desktop\M2\app\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
    TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\ASMIN\Desktop\M2\app\node_modules\bcrypt\build\bcrypt_lib.vcxproj]


    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:270:23)
    gyp ERR! stack     at emitTwo (events.js:87:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
    gyp ERR! System Windows_NT 10.0.10240
    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\ASMIN\Desktop\M2\app\node_modules\bcrypt
    gyp ERR! node -v v4.2.1
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok
    npm ERR! Windows_NT 10.0.10240
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt"
    npm ERR! node v4.2.1
    npm ERR! npm  v2.14.7
    npm ERR! code ELIFECYCLE

    npm ERR! bcrypt@0.8.5 install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the bcrypt@0.8.5 install script 'node-gyp rebuild'.
    npm ERR! This is most likely a problem with the bcrypt 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 their info via:
    npm ERR!     npm owner ls bcrypt
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\Users\ASMIN\Desktop\M2\app\npm-debug.log
Run Code Online (Sandbox Code Playgroud)

Raz*_*ssi 107

我和另一个模块有同样的问题.

我通过以下方式解决了

  • 安装visual studio community 2013
  • npm config set msvs_version 2013 --global
  • npm install bcrypt

  • `npm config set msvs_version 2013 --global`为我修好了.这可能是因为我在vs2013 express之前安装了vs2015社区 (15认同)
  • 为什么它需要依赖VS2013的东西而不注意它? (15认同)
  • 难以置信的.我一直在使用nodejs几个月,每次看到那些令人生畏的红色/紫色错误和警告,我以为我是*SOL*.最后,今天,你证明我错了 - 我终于可以像老板一样编译nodejs模块**. (4认同)
  • npm install brcrypt --msvs_version = 2013为我修复 (3认同)
  • 为什么我们依赖像Visual Studio这样的庞然大物?没有其他选择吗? (3认同)
  • "npm config set msvs_version 2017 --global"在我的情况下工作,谢谢! (3认同)

Xin*_*Xin 83

很简单,我通过简单地在VS2015中创建C++项目来解决这个问题.

基本上,当你选择创建一个c ++项目时,VS2015会要求你安装某个组件,你只需要安装它.问题将得到解决.(顺便说一下,我在Win10上使用VS2015)

  • 这需要8GB的额外工具! (6认同)
  • 差不多两年了,但你的帖子还在用.在浪费了我一整天之后,我看到你发帖了,这救了我.非常感谢.上帝祝福你 (3认同)

小智 13

我在安装业力时遇到了问题(npm模块).我从visual studio 2015安装安装了Visual c ++,它运行起来了.


use*_*548 9

在构建典型的hello_world.c控制台应用程序时,我遇到了类似的问题.原因是我决定将VS2015安装到"C:\ program files(x86)\ msvc14",但安装程序将cl.exe安装到默认的"c:\ program files(x86)\ Microsoft Visual Studio 14.0"路径.这显然是安装程序中的一个严重错误.

我将"Microsoft Visual Studio 14.0"的所有内容合并到"msvc14"目录中,现在一切正常.