在Windows中与NPM和node-gyp一起出现故障

我在我的Windows工作站上有npm包的麻烦…我的package.json文件中有一组NPM依赖关系:

 “devDependencies”:{
     “babel-plugin-transform-react-jsx”:“^ 6.2.0”,
     “babel-preset-es2015”:“^ 6.1.18”,
     “babel-preset-react”:“^ 6.1.18”,
     “grunt”:“^ 0.4.5”,
     “grunt-babel”:“^ 6.0.0”,
     “grunt-contrib-connect”:“^ 0.11.2”,
     “grunt-contrib-jasmine”:“^ 0.9.2”,
     “grunt-contrib-sass”:“^ 0.9.2”,
     “grunt-contrib-watch”:“^ 0.6.1”,
     “grunt-exec”:“^ 0.4.6”,
     “grunt-template-jasmine-requirejs”:“^ 0.2.3”,
     “karma-chrome-launcher”:“^ 0.2.2”,
     “karma-firefox-launcher”:“^ 0.1.7”,
     “karma-requirejs”:“^ 0.2.2”,
     “requirejs”:“^ 2.1.22”,
     “grunt-contrib-jshint”:“^ 0.11.3”,
     “grunt-karma”:“^ 0.12.1”,
     “业力”:“^ 0.13.15”,
     “业力 - 茉莉”:“^ 0.3.6”,
     “karma-phantomjs-launcher”:“^ 0.2.1”
   }

而当我试图运行npm install我得到了与node-gyp \msbuild.exe包相关的奇怪错误,像\msbuild.exe

这是错误:

 c:\ Users \ dmytro.medvid \ sites \ evolution \ node_modules \ utf-8-validate> if 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)
一次构build一个解决scheme中的项目。 要启用并行构build,请添加“/ m”开关。
 c:\ Users \ dmytro.medvid \ sites \ evolution \ node_modules \ utf-8-validate \ build \ validation.vcxproj(20,3):error MSB4019:导入的项目“c:\ Microsoft.Cpp.Default。
道具“找不到,确认声明中的path是否正确,文件是否在磁盘上。
 gyp ERR! build立错误
 gyp ERR! 堆栈错误:C:\ windows \ Microsoft.NET \ Framework \ v4.0.30319 \ msbuild.exe失败,退出代码:1
 gyp ERR! 在ChildProcess.onExit(c:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ node-gyp \ lib \ build.js:270:23)
 gyp ERR! 在emitTwo(events.js:87:13)
 gyp ERR! 在ChildProcess.emit(events.js:172:7)
 gyp ERR! 在Process.ChildProcess._handle.onexit(internal / child_process.js:200:12)
 gyp ERR! 系统Windows_NT 6.1.7601
 gyp ERR! 命令“c:\\ Program Files \\ nodejs \\ node.exe”“c:\\ Program Files \\ nodejs \\ node_modules \\ npm \\ node_modules \\ node-gyp \\ bin \\ node-gyp。 js“”重build“
 gyp ERR!  cwd c:\ Users \ dmytro.medvid \ sites \ evolution \ node_modules \ utf-8-validate
 gyp ERR! 节点-v v5.1.0
 gyp ERR!  node-gyp -v v3.0.3
 gyp ERR! 不好
 npm WARN安装:utf-8-validate@1.2.1 utf-8-validate@1.2.1安装:`node-gyp rebuild`
 npm WARN安装:utf-8-validate@1.2.1退出状态1
 npm WARN EPACKAGEJSON evolution@1.0.0没有版本库字段。

有人可以帮助弄清楚它的问题? 我没有经验的Windows用户,但目前我应该与Windows 🙁

更新:这是我每次更新新的NPM错误的错误日志 。

系统详细信息: Windows 7 Enterprice 64位操作系统

节点版本: v5.1.0

NPM版本: v3.3.12

Python版本: v2.7.1

另外我安装了Microsoft Visual C ++构build工具 (在下面的答案中提供)。 版本14.0

您需要使用Visual Studio打包的Microsoft Visual C ++构build工具。 但是,它们现在也可以作为独立下载使用 。 在安装这些工具并重新启动计算机之后,您应该能够安装使用node-gyp的软件包。

我在github上为node-gyp创build了一个问题 。 这也是一个类似的问题的讨价还价 。 Probaly它没有帮助我,但也许它可以对别人有用。