Search code examples
npmwindowjhipsteryarnpkg

Jhipster uml installation issue on windows : NPM fails on msbuild.exe with exit code 1


Hi I have been trying to install jhipster-uml using yarn and npm tool. But end up in error. Earlier had to down version Python from 3.6 to 2.7 to meet the npm demand. Also as per some post got windows visual studio installed using npm. Still the problem persists. Please find the error below. Let me know any one has landed in a similar situation and has solved it ?

My machine is a windows 10 running on Intel i5 core 8 gb ram.

Let me know if more details are required from my side.

Update:

  1. Tried steps from the site did not help much. Here I could not install npm install bcrypt --save faild with same error

  2. Also as pointed out in issue post here Have installed windows build tool and python. npm install --global --production windows-build-tools but this installed with success.

For yarn global add jhipster-uml

C:\Windows>yarn global add jhipster-uml
yarn global v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⠁ deasync: Build failed
[-/1] ⠁ waiting...
[-/1] ⠁ waiting...
[-/1] ⠁ waiting...
error C:\Users\ameya.shetti\AppData\Local\Yarn\config\global\node_modules\deasync: Command failed.
Exit code: 1
Command: node ./build.js
Arguments:
Directory: C:\Users\ameya.shetti\AppData\Local\Yarn\config\global\node_modules\deasync
Output:
C:\Users\ameya.shetti\AppData\Local\Yarn\config\global\node_modules\deasync>if not defined npm_config_node_gyp (node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info spawn C:\Users\ameya.shetti\.windows-build-tools\python27\python.exe
gyp info spawn args [ 'D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ameya.shetti\\AppData\\Local\\Yarn\\config\\global\\node_modules\\deasync\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\ameya.shetti\\.node-gyp\\9.3.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\ameya.shetti\\.node-gyp\\9.3.0',
gyp info spawn args   '-Dnode_gyp_dir=D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\ameya.shetti\\.node-gyp\\9.3.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\ameya.shetti\\AppData\\Local\\Yarn\\config\\global\\node_modules\\deasync',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\my.pc\\AppData\\Local\\Yarn\\config\\global\\node_modules\\deasync\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Users\ameya.shetti\AppData\Local\Yarn\config\global\node_modules\deasync\build\deasync.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:159:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ameya.shetti\AppData\Local\Yarn\config\global\node_modules\deasync
gyp ERR! node -v v9.3.0

For npm install -g jhipster-uml

C:\Windows>npm install -g jhipster-uml
C:\Users\ameya.shetti\AppData\Roaming\npm\node_modules\jhipster-uml\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Users\ameya.shetti\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\ameya.shetti\AppData\Roaming\npm\node_modules\npm\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:\Users\ameya.shetti\AppData\Roaming\npm\node_modules\jhipster-uml\node_modules\deasync\build\deasync.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\ameya.shetti\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:159:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ameya.shetti\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ameya.shetti\AppData\Roaming\npm\node_modules\jhipster-uml\node_modules\deasync
gyp ERR! node -v v9.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ameya.shetti\AppData\Roaming\npm-cache\_logs\2017-12-20T04_45_39_859Z-debug.log

Solution

  • Finally got it solved

    I actually parked the above issue and was trying to install jhipster-registry-master for jhipster microservice when I landed on the same issue. So was retried all the steps that did not work before. Got it solved this time

    So my observation to solve the above problem was

    1. npm install --global --production windows-build-tools using Command prompt (ADMIN) [Right click on start menu (win 10) to find the option in the list.]

    This installs python 2.7 and vc studio 2015. Even if you install python and set path in environment variable the npm won't detects until you follow this step.

    2. Use the same admin power shell to run the yarn command on the jhipster-registry-master and it executed successfully. Used the same power shell to instal jhipster-uml using yarn global add jhipster-uml

    This worked

    Conclusion: For jhipster-uml to work it needs the ms visual studio dependency and admin privileges to run some .cp files using the windows build tool.