npm java package not getting installed
NickName:aiman Ask DateTime:2016-08-24T15:42:09

npm java package not getting installed

npm Java package is not getting installed. Been trying this over a week now, but no success.
I have installed the Visual Studio Express 2013 for Windows.
I also have Python v2.7 installed.
Current Java version in my regedit is set to 1.7.
Before installing I did an npm config set msvs_version 2013, then I did npm install java and it threw error:

> [email protected] install C:\Users\1060641\AppData\Roaming\npm\node_modules\java
> node-gyp rebuild

C:\Users\1060641\AppData\Roaming\npm\node_modules\java>if not defined 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 )
C:\Users\1060641\AppData\Roaming\npm\node_modules\java\build\binding.sln : error MSB3411: Could not load the Visual C++ component "VCBuild.exe". If the component is not installed, either 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\1060641\AppData\Roaming\npm\node_modules\java
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "java"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the java 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 java
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\1060641\Desktop\test\npm-debug.log

Then I did npm install --msvs_version=2013.
It again threw error:

C:\Users\1060641\Desktop\test>npm install --msvs_version=2013
npm ERR! install Couldn't read dependencies
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--msvs_version=2013"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path C:\Users\1060641\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -4058

npm ERR! package.json ENOENT, open 'C:\Users\1060641\package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\1060641\Desktop\test\npm-debug.log

Then again I did npm install java --msvs_version=2013 --global.
Again there was an error:

C:\Users\1060641\Desktop\test>npm install java --msvs_version=2013 --global
/
> [email protected] install C:\Users\1060641\AppData\Roaming\npm\node_modules\java
> node-gyp rebuild


C:\Users\1060641\AppData\Roaming\npm\node_modules\java>if not defined 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 )
C:\Users\1060641\AppData\Roaming\npm\node_modules\java\build\binding.sln : error MSB3411: Could not load the Visual C++ component "VCBuild.exe". If the component is not installed, either 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\1060641\AppData\Roaming\npm\node_modules\java
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "java" "--msvs_version=2013" "--global"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the java 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 java
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\1060641\Desktop\test\npm-debug.log

I wonder what is going wrong.
I am using node version 0.12.7
And the node-gym version I installed was the latest. And in the error log some line reads:

gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok

I do not wish to upgrade my NodeJS version since its he version that our client wants us to use.
Please help!

Copyright Notice:Content Author:「aiman」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/39117253/npm-java-package-not-getting-installed

Answers
aiman 2016-08-25T10:03:07

Found a fix.\nSometimes the msvs_version parameter is not set properly.\nDid an npm config list to check the value of msvs_version.\nIt showed 2015. Changed it: npm config set msvs_version 2013 and checked for the values again: npm config list.\nInstalled one more package Microsoft Build tool 2013. This is compatible with Visual Studio 2013 Express.\nAfter that set the path for MSBuild.exe in User Environment Variable as well as System Environment Variable. For me the path was C:\\Program Files\\MSBuild\\12.0\\Bin. Append this path starting with a \";\" i.e. ;C:\\Program Files\\MSBuild\\12.0\\Bin.\nNow run npm install java. It should work.",


More about “npm java package not getting installed” related questions

npm java package not getting installed

npm Java package is not getting installed. Been trying this over a week now, but no success. I have installed the Visual Studio Express 2013 for Windows. I also have Python v2.7 installed. Current ...

Show Detail

npm package getting installed but not working

when I am using command npm install -g lerna it gets executed with no error but after that using command lerna --version gives output "lerna:command not found". Possible solution maybe if

Show Detail

grunt with java npm package not working

I am using grunt cli with npm. I have some number of packages but there is one package named as java from npm (https://www.npmjs.com/package/java). When java npm package is installed then grunt is ...

Show Detail

Find the version of an installed npm package

How can I find the version of an installed Node.js or npm package? This prints the version of npm itself: npm -v <package-name> This prints a cryptic error: npm version <package-name> ...

Show Detail

Find the version of an installed npm package

How can I find the version of an installed Node.js or npm package? This prints the version of npm itself: npm -v <package-name> This prints a cryptic error: npm version <package-name> ...

Show Detail

NPM: Why is this package installed?

How do I determine why a particular package is installed? In other words, what package(s) depend on this package? The package in question is babelify. npm ls shows it at the top level, but it is...

Show Detail

saving the already installed package with NPM in windows

I have already installed "Mongodb" package via NPM in windows without --save option. But can I update the package.json dependency list with mongodb without reinstalling it ? Is there any workaroun...

Show Detail

npm install express will cause many package to be installed

I am reading the Installing npm packages locally guide and looking for information about why when I use npm install express to install that package, nearly 40 other packages installed in the node_m...

Show Detail

npm install not finding package installed

I am installing a generator-phonegap that request the packaged phonegap that it is not finding. BUT I KNOW that is installed! I tried to install globally C:>npm install -g generator-phonegap and ...

Show Detail

How to determine where an npm package was installed from?

How can we determine where an npm package was installed from? I know we can use npm view <package> to view information about a package from a registry, but what about packages that were not

Show Detail