我的npm-lint正在抛出错误“missing script:lint”

我试图运行本地运行npm,并运行npm init,创buildpackage.json。 这是我的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" } 

有没有错过什么? 或者我需要安装更多的东西? 我收到一个错误“Missing script:lint”谢谢

你需要在你的package.json中设置linter并添加lint命令许多linter都可用。 假设你设置eslint https://www.npmjs.com/package/eslint

它会看起来像这样

 // package.json { //... "scripts": { "lint": "eslint.js" } }