我正在尝试在本地运行 npm run,并运行创建 package.json 的 npm init。这是我的 package.json
"name": "ironic-ui",
"version": "1.0.0",
"description": "======================== Team and repository tags ========================",
"main": "test-shim.js",
"directories": {
"doc": "doc"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://git.openstack.org/openstack/ironic-ui"
},
"author": "",
"license": "ISC"
}
有什么遗漏吗?还是我需要安装更多的东西?我收到错误“缺少脚本:lint”谢谢
原文由 user3339691 发布,翻译遵循 CC BY-SA 4.0 许可协议
您需要设置 linter 并在 package.json 中添加 lint 命令 许多 linter 都可用。假设你设置了 eslint https://www.npmjs.com/package/eslint
它看起来像这样