我在安装 npm软件包时遇到问题,我使用 NodeJS 5.0.0 。
我的计算机上安装了 Python 2.7.3 和 Visual Studio 2015 。我之前让VS2015与Node一起工作时遇到了问题,
error MSB4019: The imported project "...\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found
我通过将所需的路径值更改为V140
(指向VS2015目录)来修复它。现在我收到了这个错误:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not fi
nd WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid versio
n number. [c:\Users\Murhaf\Desktop\sage\node_modules\utf-8-validate\build\validation.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [c:\Users\Murhaf\Deskto
p\sage\node_modules\utf-8-validate\build\validation.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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\Murhaf\Desktop\sage\node_modules\utf-8-validate
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:utf-8-validate utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate Exit status 1

我错过了什么?
答案 0 :(得分:0)
我通过安装Windows SDK来实现它。
首先我安装了Windows 10 SDK,但它无效。
其次我安装了Windows 7 SDK,它也没有用。
最后,我推出了VS2015卸载程序,我选择修改添加WINDOWS 8.1 SDK功能,我使用VS2015安装程序安装它然后就可以了。
我认为原因是它的注册表项,但我不想花更多的时间,Windows SDK 8.1解决了这个问题。