These types of questions are a dime a dozen, and I've gone through resource after resource but nothing seems to work:
- https://github.com/nodejs/node-gyp/issues/629
- NodeJS - Error installing with NPM
- http://blog.jimdhughes.com/2015/04/09/perils-with-node-gyp-and-windows-development/
Here's the deal, I'm pretty new to NodeJS and Aurelia, however my ancedotal experience is that with the advent of the recent front-end revolution and with all of its tooling, folks really made things look deceptively simple.
I'm sure we've all seen commands akin to: "just run do my-work-for-me
and your project is done!"
Take for instance the Aurelia guide. After navigating to the working directory, all you need to do is run:
npm install
Well, no. npm install
depends on node-gyp
, which you must install manually. Well, you can't install node-gyp
before you install Python. But don't get the latest one, since > 3.x is not supported. Once you install that, you encounter issues with C++ compilers required by node-gyp
. So we install Microsoft VS 2012 to get the compilers.
What I've done:
Set PYTHON as an environment variable
C:\Users\[name]>py Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
Set the applicable VS version in npm, as proven by the getter:
C:\Users\[name]>npm config get msvs_version 2012
That said, I still encounter the following error when I attempt to run npm install
from my application's target directory:
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit c
ode: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\nod
e-gyp\lib\build.js:270:23)
gyp ERR! stack at emitTwo (events.js:88:13)
gyp ERR! stack at ChildProcess.emit (events.js:173:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:201:12)
gyp ERR! System Windows_NT 6.1.7601
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:\_workspaces\skeleton-navigation-1.0.0-beta.1.0.2\node_modules\utf-8-validate
gyp ERR! node -v v5.2.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:utf-8-validate@1.2.1 utf-8-validate@1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate@1.2.1 Exit status 1