I have a Azure DevOps build step that runs gulp for an angularjs application. I set the Gulp file path to point to the GulpFile.js
the referenced task should bundle the app and put the files into a zip file in the solution folder. This works fine when I run this locally in Visual Studio.
The error I am getting during the build is the following:
2019-07-08T15:54:56.5447810Z Task : Gulp 2019-07-08T15:54:56.5447868Z Description : Node.js streaming task based build system 2019-07-08T15:54:56.5447921Z Version : 0.141.2 2019-07-08T15:54:56.5447966Z Author : Microsoft Corporation 2019-07-08T15:54:56.5448064Z Help : More Information 2019-07-08T15:54:56.5448113Z ============================================================================== 2019-07-08T15:54:57.7184034Z [command]C:\Users\MYUSER\AppData\Roaming\npm\gulp.cmd Export --gulpfile C:\a_work\15\s\UI\Gulpfile.js 2019-07-08T15:54:58.6597682Z [[90m15:54:58[39m] Local modules not found in C:\a_work\15\s\UI 2019-07-08T15:54:58.6597830Z [[90m15:54:58[39m] Try running: npm install
Does this error occur because Node is missing the necessary modules to bundle the app. Can I make the bundle task call npm install for the app before continueing the task?
2条答案
按热度按时间s4n0splo1#
你可以添加一个任务只是在大口构建之前做
npm install
:lqfhib0f2#
Azure devops代理有自己的
node.exe
,安装在...\_work\_tool\node\
(节点bin位置)中,例如D:\azure_devops_agent\_work\_tool\node\10.24.1\x64\node.exe
。如果您的
package.json
(对于npm
)或gulpfile.js
(对于gulp
)位于子文件夹中,则应提供其路径。如果您使用的是传统管道并使用
command line
任务,则应在运行gulp
命令之前按以下方式提供:截图: