npm install fails with gyp build error

11,798

Installing windows build tools worked for me:

npm install --global --production windows-build-tools

Follow : https://github.com/nodejs/node-gyp#installation

Share:
11,798
Admin
Author by

Admin

Updated on August 02, 2022

Comments

  • Admin
    Admin almost 2 years

    I have been trying to get node and git working for a web project I am working on without any luck.

    I have installed node from their website. When I try to do npm install on the git project I am working on it gives me the following error

    C:\Users\Jibran\Desktop\ekhadim\ekhadimweb>npm install
    npm http GET https://registry.npmjs.org/bcrypt
    npm http 304 https://registry.npmjs.org/bcrypt
    npm http GET https://registry.npmjs.org/bindings
    npm http 304 https://registry.npmjs.org/bindings
    
    > [email protected] install C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\b
    crypt
    > node-gyp rebuild
    
    
    C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\bcrypt>node "C:\Program
    Files\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\Microsoft.Cpp.InvalidPlatform
    .Targets(23,7): error MSB8007: The Platform for project 'bcrypt_lib.vcxproj' is
     invalid.  Platform='x64'. You may be seeing this message because you are tryin
    g to build a project without a solution file, and have specified a non-default
    Platform that doesn't exist for this project. [C:\Users\Jibran\Desktop\ekhadim\
    ekhadimweb\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
    gyp ERR! build error
    gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\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:267:23)
    gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:
    12)
    gyp ERR! System Windows_NT 6.2.9200
    gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
    les\\node-gyp\\bin\\node-gyp.js" "rebuild"
    gyp ERR! cwd C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\bcrypt
    gyp ERR! node -v v0.10.28
    gyp ERR! node-gyp -v v0.13.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 bcrypt 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 bcrypt
    npm ERR! There is likely additional logging output above.
    
    npm ERR! System Windows_NT 6.2.9200
    npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
    ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
    npm ERR! cwd C:\Users\Jibran\Desktop\ekhadim\ekhadimweb
    npm ERR! node -v v0.10.28
    npm ERR! npm -v 1.4.9
    npm ERR! code ELIFECYCLE
    npm ERR!
    npm ERR! Additional logging details can be found in:
    npm ERR!     C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\npm-debug.log
    npm ERR! not ok code 0
    

    I have installed python, VC++ 2008 and 2010 and OpenSSL but nothing has worked for me yet.

    Any help will be appreciated.

    Thanks Jibran