stylelint giving error on iOs - Error: Could not find "stylelint-config-standard". Do you need a `configBasedir`?

Viewed 3190

It works ok on ubuntu

I installed stylelint on iOS but when I run it I get

Error: Could not find "stylelint-config-standard". Do you need a configBasedir?

My config file is:

$ cat .stylelintrc.json
{
  "extends": "stylelint-config-standard",
  "rules": {
    "rule-empty-line-before": null,
    "at-rule-empty-line-before": null
  }
}

I tried "extends": ["stylelint-config-standard"], but it didn't help

3 Answers

I had that error message until I installed the config

npm install stylelint-config-standard --save-dev

If you have the stylelint-config-standard dependency installed already, maybe you need to delete the node_modules folder and package-lock.json or yarn.lock if you're using yarn, and run the following command:

npm install

or with yarn

yarn install

if the stylelint-config-standard dependency isn't installed may you need to install it running:

npm install stylelint-config-standard -D

or with yarn

yarn add stylelint-config-standard -D

First, as tried, change the extends to be

"extends": ["stylelint-config-standard"],

but then also do npm install

Related