繁体   English   中英

在 Visual Studio Online 中安装 npm 失败

[英]npm install in Visual Studio Online fails

我有一个 Web 应用程序,前端使用 Angular 构建,后端使用 MVC、WebApi 构建。 我正在致力于在 Visual Studio Online 上创建 CI 环境。 现在,npm 安装和运行 grunt 任务由 .cmd 文件处理并包含在 Visual Studio Web 项目的构建过程中。

当我在 VSO 中添加构建步骤时,我已经将构建步骤分离到 NuGet 安装、解决方案构建、npm 安装、grunt 任务运行等(我也从项目中删除了 .cmd 文件的执行)。

但是当 npm install 步骤发生时,它失败并出现以下错误..

******************************************************************************
Starting task: npm install
******************************************************************************
Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\tasks\NpmInstall\0.1.3\NpmInstall.ps1
C:\Program Files\nodejs\npm.cmd  install
npm WARN package.json grunt-XXXXXXX-Identity@0.1.0 No description
npm WARN package.json grunt-XXXXXXX-Identity@0.1.0 No README data
npm WARN package.json grunt-XXXXXXX-Identity@0.1.0 No license field.
npm WARN peerDependencies The peer dependency tslint@^2.0.1 included from grunt-tslint will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN optional dep failed, continuing fsevents@1.0.0
> v8-profiler@5.2.12 preinstall C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-profiler
>  
> v8-debug@0.4.6 preinstall C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug
>  
npm WARN optional dep failed, continuing default-browser-id@1.0.2
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.7","npm":"2.11.3"})
> bufferutil@1.1.0 install C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\bufferutil
> node-gyp rebuild
C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\bufferutil>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 ) 
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  bufferutil.cc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception(361): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc [C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\bufferutil\build\bufferutil.vcxproj]
     Creating library C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\bufferutil\build\Release\bufferutil.lib and object C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\bufferutil\build\Release\bufferutil.exp
  Generating code
  Finished generating code
  bufferutil.vcxproj -> C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\bufferutil\build\Release\\bufferutil.node
> utf-8-validate@1.1.0 install C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\utf-8-validate
> node-gyp rebuild
C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\utf-8-validate>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 ) 
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  validation.cc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception(361): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc [C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\utf-8-validate\build\validation.vcxproj]
     Creating library C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\utf-8-validate\build\Release\validation.lib and object C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\utf-8-validate\build\Release\validation.exp
  Generating code
  Finished generating code
  validation.vcxproj -> C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\ws\node_modules\utf-8-validate\build\Release\\validation.node
> v8-profiler@5.2.12 install C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-profiler
> node-pre-gyp install --fallback-to-build
 Success: "C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-profiler\build\profiler\v5.2.12\node-v14-win32-x64\profiler.node" is installed via remote
> v8-debug@0.4.6 install C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug
> node-pre-gyp install --fallback-to-build
C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug>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" clean )  else (node  clean ) 
C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug>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" configure --fallback-to-build "--module=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\v0.4.6\node-v14-win32-x64\debug.node" --module_name=debug "--module_path=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\v0.4.6\node-v14-win32-x64" )  else (node  configure --fallback-to-build "--module=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\...
Warning: Missing input files:
C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\..\..\..\..\..\..\..\..\..\..\..\..\..\..\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c
C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug>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" build --fallback-to-build "--module=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\v0.4.6\node-v14-win32-x64\debug.node" --module_name=debug "--module_path=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\v0.4.6\node-v14-win32-x64" )  else (node  build --fallback-to-build "--module=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\v0.4.6\n...
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  debug.cc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception(361): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc [C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug.vcxproj]
  win_delay_load_hook.c
c1 : fatal error C1083: Cannot open source file: '..\..\..\..\..\..\..\..\..\..\..\..\..\..\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c': No such file or directory [C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug.vcxproj]
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:\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.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\a\\02e68ad0\\XXXX XXXXXX\\Source\\XXXXXXX.Identity\\XXXXXXX.Identity.Web\\_ci\\node_modules\\grunt-debug-task\\node_modules\\node-inspector\\node_modules\\v8-debug\\build\\debug\\v0.4.6\\node-v14-win32-x64\\debug.node" "--module_name=debug" "--module_path=C:\\a\\02e68ad0\\XXXX XXXXXX\\Source\\XXXXXXX.Identity\\XXXXXXX.Identity.Web\\_ci\\node_modules\\grunt-debug-task\\node_modules\\node-inspector\\node_modules\\v8-debug\\build\\debug\\v0.4.6\\node-v14-win32-x64"
gyp ERR! cwd C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\v0.4.6\node-v14-win32-x64\debug.node --module_name=debug --module_path=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\v0.4.6\node-v14-win32-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:1015:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command "node" "C:\\a\\02e68ad0\\XXXX XXXXXX\\Source\\XXXXXXX.Identity\\XXXXXXX.Identity.Web\\_ci\\node_modules\\grunt-debug-task\\node_modules\\node-inspector\\node_modules\\v8-debug\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug
node-pre-gyp ERR! node -v v0.12.7
node-pre-gyp ERR! node-pre-gyp -v v0.6.11
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\v0.4.6\node-v14-win32-x64\debug.node --module_name=debug --module_path=C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\node_modules\grunt-debug-task\node_modules\node-inspector\node_modules\v8-debug\build\debug\v0.4.6\node-v14-win32-x64' (1)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! v8-debug@0.4.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v8-debug@0.4.6 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the v8-debug package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls v8-debug
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\a\02e68ad0\XXXX XXXXXX\Source\XXXXXXX.Identity\XXXXXXX.Identity.Web\_ci\npm-debug.log
Unexpected exit code 1 returned from tool npm.cmd

我在使用 .cmd 脚本时也遇到了这个问题。 我做了一个 npm 更新,它运行良好。 我在执行npm install之前在脚本上执行了以下命令

npm install npm@latest
npm update --depth=0 -g

这让它工作。 但是当我在 VSO 中使用构建步骤时,我不能这样做。 为什么会出现这个错误,我该如何解决这个问题。 另外,我如何执行 npm 更新步骤 VSO 构建步骤?

您需要添加一个 npm install 构建步骤。 默认情况下,工作目录 defaults 是项目的根目录。 并在 Arguments 字段中指定 npm install 参数。 喜欢:

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM