abdulbari
abdulbari

Reputation: 6232

NPM install failing in windows-7

I am doing NPM install in windows-7 and I don't know why I am getting this error.

 C:\xampp\htdocs\dev4\nodejs\node_modules\jsdom\node_modules\contextify>node "C:\
 Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules
\node-gyp\bin\node-gyp.js" 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.t
argets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform T
oolset = 'v100') cannot be found. To build using the v100 build tools, please i
nstall Visual Studio 2010 build tools.  Alternatively, you may upgrade to the c
urrent Visual Studio tools by selecting the Project menu or right-click the sol
ution, and then selecting "Upgrade Solution...". [C:\xampp\htdocs\dev4\nodejs\n
ode_modules\jsdom\node_modules\contextify\build\contextify.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_mo
dules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\nod
e_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xampp\htdocs\dev4\nodejs\node_modules\jsdom\node_modules\context
ify
gyp ERR! node -v v0.10.31
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\xampp\htdocs\dev4\nodejs
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\xampp\htdocs\dev4\nodejs\npm-debug.log
npm ERR! not ok code 0

I tried to do separate module, but the module is not installed since internally it's dependent to another required module.

I did Google a lot but didn't get any solution.

Any suggestion will be helpful for me.

Upvotes: 0

Views: 1746

Answers (2)

Charlestown
Charlestown

Reputation: 141

From the node-gyp documents for Windows, you can choice:

Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).

Upvotes: 0

Matthew Bakaitis
Matthew Bakaitis

Reputation: 11970

From your posted error log, node-gyp cannot find a copy of Visual Studio to use in the build process.

From the node-gyp documents for Windows, you need:

  • Python (v2.7.3 recommended, v3.x.x is not supported)
  • Windows XP/Vista/7:
    • Microsoft Visual Studio C++ 2010 (Express version works well)
    • For 64-bit builds of node and native modules you will also need the Windows 7 64-bit SDK
    • If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first.
    • If you get errors that the 64-bit compilers are not installed you may also need the compiler update for the Windows SDK 7.1
  • Windows 7/8: Microsoft Visual Studio C++ 2012/13 for Windows Desktop (Express version works well)

Make sure you have a copy of Visual Studio Express or better installed and try again.

Upvotes: 2

Related Questions