gpt4 book ai didi

azure - npm 错误缺少脚本 : build (Set up CI with Azure Pipelines)

转载 作者:行者123 更新时间:2023-12-04 12:03:29 26 4
gpt4 key购买 nike

我正在使用 Microsoft 的 Azure DevOps 并尝试构建管道。当我运行它时,出现以下错误(请注意,我使用的是 Nodejs):

2019-02-27T14:51:52.8760703Z ##[section]Starting: npm install and build
2019-02-27T14:51:52.8763347Z ==============================================================================
2019-02-27T14:51:52.8763405Z Task : Command Line
2019-02-27T14:51:52.8763440Z Description : Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
2019-02-27T14:51:52.8763490Z Version : 2.146.1
2019-02-27T14:51:52.8763523Z Author : Microsoft Corporation
2019-02-27T14:51:52.8763557Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
2019-02-27T14:51:52.8763604Z ==============================================================================
2019-02-27T14:51:53.0258171Z Generating script.
2019-02-27T14:51:53.0326177Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/10b6fcd3-847a-4422-bb84-ba6e0b8ca7cb.sh
2019-02-27T14:51:54.3278066Z npm WARN <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5c34333026303d293a1c6d726c726c" rel="noreferrer noopener nofollow">[email protected]</a> No description
2019-02-27T14:51:54.3278893Z npm WARN <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="066e696a7c6a677360463728362836" rel="noreferrer noopener nofollow">[email protected]</a> No repository field.
2019-02-27T14:51:54.3279186Z
2019-02-27T14:51:54.5749996Z audited 175 packages in 1.032s
2019-02-27T14:51:54.5757001Z found 0 vulnerabilities
2019-02-27T14:51:54.5757413Z
2019-02-27T14:51:54.8302910Z npm ERR! missing script: build
2019-02-27T14:51:55.4914767Z
2019-02-27T14:51:55.4916102Z npm ERR! A complete log of this run can be found in:
2019-02-27T14:51:55.4916931Z npm ERR! /home/vsts/.npm/_logs/2019-02-27T14_51_54_831Z-debug.log
2019-02-27T14:51:55.5084373Z ##[error]Bash exited with code '1'.
2019-02-27T14:51:55.5117395Z ##[section]Finishing: npm install and build

这是我的 package.json:

{
"name": "holzlauf",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --config webpack.conf.js",
"deploy": "npm run build && gh-pages -d build",
"start": "node app.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"applicationinsights": "^1.1.0",
"body-parser": "^1.18.3",
"ejs": "^2.6.1",
"express": "^4.16.4",
"nodemailer": "^5.1.1",
"serve-favicon": "^2.5.0"
}
}

非常感谢您的帮助!

最佳答案

这意味着在你的“package.json”中(在运行“npm run build”的文件夹中),没有“build”脚本

{ 
"name": "Example Application",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "echo 'build script executed'"
},
"author": "",
"license": ""
}

引用: https://www.quora.com/What-does-it-mean-when-you-get-the-NPM-error-missing-script-build

关于azure - npm 错误缺少脚本 : build (Set up CI with Azure Pipelines),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54908263/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com