正在Visual Studio项目的生成后事件中运行npm安装

问题描述 投票:0回答:1

在项目的构建后事件中,我有2个任务-运行npm install,然后运行gulpfile。

[我正在使用Azure DevOps,并且在我的构建管道中,当在项目的构建后事件中运行npm install时,它仅运行npm install命令,而不运行gulpfile。它输出:

enter image description here

但是,如果在项目的构建后事件中运行npm install之前运行package.json任务(直接指向我的npm install,则gulpfile确实会运行。

我想知道这里的问题是什么?是因为我没有在构建后事件中指定package.json吗?

我的构建后事件脚本如下:

npm install
node.exe "node_modules\gulp\bin\gulp.js" --gulpfile "gulpfile.js"
npm tfs azure-devops visual-studio-2019 post-build-event
1个回答
1
投票

问题是,在构建后事件脚本中直接调用npm install会停止父批处理程序。解决此问题的方法是使用记录在call中的命令here。也就是说,使用call npm install

© www.soinside.com 2019 - 2024. All rights reserved.