03 July 2015

node install bypass Visual Studio 2010 build tools

node install error "please install Visual Studio 2010 build tools" 

Running node install on a recent project that i had not build before got me the error message pasted below, related to msbuild 2010 in a node context.
At first i believed there was an error in path because of build.js in "Failed at the node-sass@1.0.3 install script 'node build.js'" and maybe the path to msbuild got cought up.
But after an extensive search i finally came upon this nice little comment:


https://github.com/TooTallNate/node-gyp/issues/154#issuecomment-30200420
I installed VS2012, and now have to include --msvs_version=2012 in any npm install calls that will include native modules. (seanmonstar)

Reading the full error message one could find this statement:
The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.

The Solution: npm install --msvs_version=2013


Full error message

> node-sass@1.0.3 install D:\Solutions\xxx\node_modules\grunt-sass\node_modules\node-sass
> node build.js

child_process: customFds option is deprecated, use stdio instead.

D:\Solutions\xxx\node_modules\grunt-sass\node_modules\node-sass>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modu
les\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (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\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform To
olset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools.  Alternatively, you may upgrade to the cur
rent Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". [D:\Solutions\xxx\node_modules\grunt-sass\node_modules\node-sass\build\binding.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.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 D:\Solutions\xxx\node_modules\grunt-sass\node_modules\node-sass
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
Build failed
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! node-sass@1.0.3 install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@1.0.3 install script 'node build.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Solutions\xxx\npm-debug.log

The Solution: npm install --msvs_version=2013

 D:\Solutions\xxx\xxx>npm install --msvs_version=2013
npm WARN package.json xxx@0.0.1 No repository field.
npm WARN package.json xxx@0.0.1 No README data
npm WARN package.json xxx@0.0.1 No license field.
/
> node-sass@1.0.3 install D:\Solutions\xxx\node_modules\grunt-sass\node_modules\node-sass
> node build.js

child_process: customFds option is deprecated, use stdio instead.

D:\Solutions\xxx\node_modules\grunt-sass\node_modules\node-sass>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modu
les\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (rebuild)
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
cl : Command line warning D9025: overriding '/GR-' with '/GR' [D:\Solutions\xxx\node_modules\grunt-sass\node_modules\node-sass\build\bindi
ng.vcxproj]
......

[And it went on - Happy `til the end]

No comments: