问题描述
我有一个Azure DevOps构建步骤,可为angularjs应用程序运行gulp.我将Gulp文件路径设置为指向 GulpFile.js
,所引用的任务应捆绑该应用程序并将文件放入解决方案文件夹中的zip文件中.当我在Visual Studio中本地运行此程序时,效果很好.
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:
是否发生此错误,因为Node缺少捆绑应用程序的必要模块.我可以在继续执行任务之前为应用程序进行捆绑任务调用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?
推荐答案
您可以添加一个任务,只需在gulp构建之前执行 npm install
即可:
You can add a task just do the npm install
before the gulp build:
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
command: install
workingDir: '$(Build.SourcesDirectory)'
verbose: false
这篇关于Azure DevOps gulp步骤失败,找不到本地模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!