Windows上的Jhipster uml安装问题:msbuild.exe上的NPM失败,退出代码为1

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Windows上的Jhipster uml安装问题:msbuild.exe上的NPM失败,退出代码为1相关的知识,希望对你有一定的参考价值。

嗨,我一直在尝试使用yarn和npm工具安装jhipster-uml。但最终出错了。早先不得不将Python版本从3.6降低到2.7以满足npm需求。另外根据一些帖子使用npm安装windows visual studio。问题仍然存在。请在下面找到错误。让我知道任何人已陷入类似的情况并解决了它?

我的机器是运行在Intel i5核心8 GB RAM上的Windows 10。

如果我需要更多细节,请告诉我。

更新:

  1. site尝试的步骤没有多大帮助。在这里,我无法安装npm install bcrypt --save faild同样的错误
  2. 另外正如here发布的帖子中指出的那样安装了windows build工具和python。 npm install --global --production windows-build-tools但是安装成功了。

对于纱线全球添加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:Usersameya.shettiAppDataLocalYarnconfigglobal
ode_modulesdeasync: Command failed.
Exit code: 1
Command: node ./build.js
Arguments:
Directory: C:Usersameya.shettiAppDataLocalYarnconfigglobal
ode_modulesdeasync
Output:
C:Usersameya.shettiAppDataLocalYarnconfigglobal
ode_modulesdeasync>if not defined npm_config_node_gyp (node "D:Program Files
odejs
ode_modules
pmin
ode-gyp-bin\....
ode_modules
ode-gypin
ode-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@9.3.0 | win32 | x64
gyp info spawn C:Usersameya.shetti.windows-build-toolspython27python.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)MSBuild14.0inmsbuild.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:Usersameya.shettiAppDataLocalYarnconfigglobal
ode_modulesdeasyncuilddeasync.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)MSBuild14.0inmsbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:Program Files
odejs
ode_modules
pm
ode_modules
ode-gyplibuild.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:Usersameya.shettiAppDataLocalYarnconfigglobal
ode_modulesdeasync
gyp ERR! node -v v9.3.0

对于npm install -g jhipster-uml

C:Windows>npm install -g jhipster-uml
C:Usersameya.shettiAppDataRoaming
pm
ode_modulesjhipster-uml
ode_modulesdeasync>if not defined npm_config_node_gyp (node "C:Usersameya.shettiAppDataRoaming
pm
ode_modules
pm
ode_modules
pm-lifecycle
ode-gyp-bin\....
ode_modules
ode-gypin
ode-gyp.js" rebuild )  else (node "C:Usersameya.shettiAppDataRoaming
pm
ode_modules
pm
ode_modules
ode-gypin
ode-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:Usersameya.shettiAppDataRoaming
pm
ode_modulesjhipster-uml
ode_modulesdeasyncuilddeasync.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)MSBuild14.0inmsbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:Usersameya.shettiAppDataRoaming
pm
ode_modules
pm
ode_modules
ode-gyplibuild.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:Usersameya.shettiAppDataRoaming
pm
ode_modulesjhipster-uml
ode_modulesdeasync
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! deasync@0.1.9 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the deasync@0.1.9 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:Usersameya.shettiAppDataRoaming
pm-cache\_logs2017-12-20T04_45_39_859Z-debug.log
答案

终于解决了

我实际上停放了上述问题,当我登陆同样的问题时,我正试图为jhipster微服务安装jhipster-registry-master。所以重试了以前没有用过的所有步骤。这次解决了

所以我对解决上述问题的观察是

1. npm install --global --production windows-build-tools使用命令提示符(ADMIN)[右键单击开始菜单(win 10)以查找列表中的选项。]

这将安装python 2.7和vc studio 2015.即使您在环境变量中安装python并设置路径,在您执行此步骤之前,npm也不会检测到。

2.使用相同的admin power shell在jhipster-registry-master上运行yarn命令并成功执行。使用相同的电源外壳使用yarn global add jhipster-uml安装jhipster-uml

这很有效

结论:对于jhipster-uml工作,它需要ms visual studio依赖项和管理员权限才能使用windows build工具运行一些.cp文件。

以上是关于Windows上的Jhipster uml安装问题:msbuild.exe上的NPM失败,退出代码为1的主要内容,如果未能解决你的问题,请参考以下文章

jhipster安装_Windows

npm install -g generator-jhipster Windows 问题与 python

无法安装 jhipster-generator

微服务上的 Jhipster + PertmitAll

markdown JHipster上的角度材料

Jhipster 上的 ERR_SSL_VERSION_OR_CIPHER_MISMATCH