问题
A little background:
My team has a web branding project in Visual Studio, just static HTML, CSS and a little javascript - no .NET classes or anything.
We added node, npm, gulp and some gulp task packages to take care of some bundling and minification.
The gulp tasks run fine via the Task Runner Explorer, no issues.
However, some of our team are getting an error when attempting to build the project (in order to view the static pages in browsers through IIS):
Error 13 The command ""C:\TFS\Branding\packages\Gulp.js.1.0.2\build..\tools\npm.cmd" install gulp gulp-util --save-dev" exited with code 1. Branding
I have not been able to determine why this is occuring or why it only happens for some of the team. We are using a mixture of VS2013 and 2015, but the error can occur on either.
I can see that the command in question does exist at the location - on one of the affected environments, if I run:
npm install gulp gulp-util --save-dev
from the command prompt in the project root - it installs without error, yet the VS project still produces the error.
I'm stumped, and any ideas on what to look into would be greatly appreciated.
回答1:
Your location "C:\TFS\Branding\packages\Gulp.js.1.0.2\build..\tools\npm.cmd" tells me that this is installed with nuget (because of the packages folder). You should not use nuget if you only do client side developing, use npm and bower instead - especially there is good support now in VS 2013 and 2015.
回答2:
Had the same issue. There is a build task in the gulp package. We added the gulp directory under "SolutionName"\node_modules\gulp to solve this
来源:https://stackoverflow.com/questions/31968608/visual-studio-2013-2015-node-package-build-error-gulp-util