Reputation: 4024
I have a web application with front end build with Angular and backend built with MVC, WebApi. I am working on creating a CI environment on Visual Studio Online. Right now, the npm install and running grunt tasks are handled by a .cmd file and included in the Build Process of the Visual Studio Web project.
When i'm adding build steps in VSO i have separataed out the build steps in to NuGet Install, Solution Build, npm install, grunt task running etc. ( i have removed the execution of .cmd file from the project as well).
But when npm install step is happening, it fails with the following error..
******************************************************************************
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 [email protected] No description
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] 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 [email protected]
> [email protected] 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
>
> [email protected] 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 [email protected]
npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.7","npm":"2.11.3"})
> [email protected] 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
> [email protected] 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
> [email protected] 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
> [email protected] 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! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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
I ran in to this issue when i was using the .cmd script as well. I did an npm update and the it worked fine. I executed the following commands on the script before executing npm install
npm install npm@latest
npm update --depth=0 -g
This got it working. But i can not do this when i am using a build step in VSO. Why is this error showing up and how can i fix this. Additionally how can i do the npm update step VSO build step?
Upvotes: 2
Views: 7216
Reputation: 5010
You need to add one npm install build step. By default, the working directory defaults is the root of the project. And specify the npm install argument in the Arguments field. Like:
Upvotes: 2