Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

my npm-lint is throwing error "missing script: lint"

Tags:

node.js

npm

I am trying to run npm run locally, and ran npm init, that created package.json. Here is my 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"
 }

Is there missing something? Or do i need to install something more? I am getting an error "Missing script: lint" Thanks

like image 207
user3339691 Avatar asked Jun 13 '17 18:06

user3339691


Video Answer


1 Answers

You need to setup linter and add lint command in your package.json Many linter are available. Assuming you setup eslint https://www.npmjs.com/package/eslint

it would look something like this

// package.json
{ 
  //...
  "scripts": {
    "lint": "eslint.js"
  }
}
like image 67
roxxypoxxy Avatar answered Sep 17 '22 15:09

roxxypoxxy