在npm中安装ws会导致node-gyp错误。

时间:2021-07-15 20:29:51

I am working with:

我处理:

Windows 10 64bit Node 0.12.7 NPM : 2.11.3

Windows 10 64位节点0.12.7 NPM: 2.11.3。

I am going through a MEAN stack tutorial, i am trying to run the following:

我正在经历一个平均的堆栈教程,我正在尝试运行如下:

npm install --save ws

npm安装,节省ws

I get this error message:

我得到这个错误信息:

C:\Dev\workspace\MeanProject\NodeServer>npm install --save ws
npm WARN package.json socialapp@ No description
npm WARN package.json socialapp@ No repository field.
npm WARN package.json socialapp@ No README data
npm WARN package.json socialapp@ No license field.
/
> utf-8-validate@1.2.1 install C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild


C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\node_modules\utf-8-validate>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.targe
ts(366,5): warning MSB8003: Could not find WindowsSDKDir variable from the regi
stry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid versi
on number. [C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\node_mo
dules\utf-8-validate\build\validation.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the
 file specified. [C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\n
ode_modules\utf-8-validate\build\validation.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:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\node_modules\utf-8-validate
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok

> bufferutil@1.2.1 install C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild


C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\node_modules\bufferutil>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.targe
ts(366,5): warning MSB8003: Could not find WindowsSDKDir variable from the regi
stry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid versi
on number. [C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\node_mo
dules\bufferutil\build\bufferutil.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the
 file specified. [C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\n
ode_modules\bufferutil\build\bufferutil.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:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Dev\workspace\MeanProject\NodeServer\node_modules\ws\node_modules\bufferutil
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing utf-8-validate@1.2.1
npm WARN optional dep failed, continuing bufferutil@1.2.1
ws@0.8.0 node_modules\ws

I have the 2015 VS.

我有2015年的VS。

Any help would be appreciated.

如有任何帮助,我们将不胜感激。

2 个解决方案

#1


2  

CL.exe is part of C++ dev environment. It is not installed by default. So, creating a new C++ Project in Visual Studio installs all needed components, including cl.exe. You can find it under "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe" and it's on path when launching "Developer Command Prompt for VS2015."

CL。exe是c++开发环境的一部分。它不是默认安装的。因此,在Visual Studio中创建一个新的c++项目将安装所有需要的组件,包括cl.exe。您可以在“C:\程序文件(x86)\Microsoft Visual Studio 14.0\VC\bin\cl中找到它”。exe“在启动VS2015的开发人员命令提示时,它正在运行。”

#2


1  

This is because of running older version of gcc. Install the latest and the issue will be solved. Check this out for more details: https://github.com/assaf/zombie/issues/956

这是因为运行了较老版本的gcc。安装最新的,这个问题将会得到解决。请查看此信息以获取更多信息:https://github.com/assaf/zombie/es/956。

#1


2  

CL.exe is part of C++ dev environment. It is not installed by default. So, creating a new C++ Project in Visual Studio installs all needed components, including cl.exe. You can find it under "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe" and it's on path when launching "Developer Command Prompt for VS2015."

CL。exe是c++开发环境的一部分。它不是默认安装的。因此,在Visual Studio中创建一个新的c++项目将安装所有需要的组件,包括cl.exe。您可以在“C:\程序文件(x86)\Microsoft Visual Studio 14.0\VC\bin\cl中找到它”。exe“在启动VS2015的开发人员命令提示时,它正在运行。”

#2


1  

This is because of running older version of gcc. Install the latest and the issue will be solved. Check this out for more details: https://github.com/assaf/zombie/issues/956

这是因为运行了较老版本的gcc。安装最新的,这个问题将会得到解决。请查看此信息以获取更多信息:https://github.com/assaf/zombie/es/956。