Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error: Cannot read property 'ecmaFeatures' of undefined (null) #1163

Closed
camux opened this issue Jul 11, 2018 · 14 comments

Comments

@camux
Copy link

commented Jul 11, 2018

What version of standard?
11.01

What operating system, Node.js, and npm version?
Ubuntu, Node v9.0.0, npm 6.1.0

What did you expect to happen?
This linter warning should not appear

What actually happened?
In Atom editor appear this message in all js files
Provider: js-standard Parsing error: Cannot read property 'ecmaFeatures' of undefined (null)

My package.json
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.5",
"babel-jest": "20.0.3",
"babel-polyfill": "^6.26.0",
"eslint": "^5.0.1",
"eslint-plugin-react": "^7.10.0",
"jest": "20.0.4",
"react-test-renderer": "^16.3.2",
"standard": "^11.0.1"
}

This problem occurs after update several devs packages

@Autre31415

This comment has been minimized.

Copy link

commented Jul 12, 2018

I found a way to replicate this issue:

It is caused by having both eslint 5+ and standard as dependencies in a project. The bit that was most confusing was the fact that I've witnessed many repos which have both and still work fine, but if you nuke the node_modules and package-lock.json on that project and reinstall completely fresh you will now experience this bug.

In the case of @camux updating several dev packages (likely including eslint 5) created both conditions required to expose this issue.

  • Having both eslint 5+ and standard as devDeps on the project
  • Having a fresh updated package-lock.json that takes these into consideration
@camux

This comment has been minimized.

Copy link
Author

commented Jul 12, 2018

thanks @Autre31415 at this moment I downgrade to eslint package to version 4.19.1 and problem was solved!

@bonesoul

This comment has been minimized.

Copy link

commented Jul 18, 2018

any fixes for this?

@likeshumidity

This comment has been minimized.

Copy link

commented Aug 8, 2018

See response by @tmilar xojs issue #336:

npm install --save-dev --save-exact eslint-plugin-node@7.0.1

this fixes for me.

NOTE: I am not running xojs, just happened upon that as a fix.

PatrickJS added a commit to tipeio/eslint-config-tipe that referenced this issue Aug 8, 2018

@lannonbr

This comment has been minimized.

Copy link

commented Aug 29, 2018

With the update of Standard v12, this bug seems to be resolved.

@Kikobeats

This comment has been minimized.

Copy link

commented Aug 31, 2018

For me this appeared after v12 version :(

@lannonbr

This comment has been minimized.

Copy link

commented Aug 31, 2018

If you have a package that installs both ESLint 4.x and 5.x, this will occur to a bug with acorn

@wmhilton wmhilton referenced this issue Sep 2, 2018
@wmhilton

This comment has been minimized.

Copy link

commented Sep 2, 2018

I have this problem introduced by v12. I'm not directly depending on eslint... could it be conflicting with prettier-standard?

@lannonbr

This comment has been minimized.

Copy link

commented Sep 2, 2018

@wmhilton Prettier-standard has a dependency of eslint@4.x so yes

mikesamuel added a commit to mikesamuel/sh-template-tag that referenced this issue Sep 8, 2018

Try to fix Travis CI failure on Node 7
Standard fails when running lint at https://travis-ci.org/mikesamuel/sh-template-tag/jobs/426025380

    .../sh-template-tag/index.js:0:0: Parsing error: Cannot read property 'ecmaFeatures' of undefined

Added explicit dev dependency on a modern version of
eslint-plugin-node per
standard/standard#1163 (comment)
@wmhilton

This comment has been minimized.

Copy link

commented Sep 18, 2018

Hmm... I think I'm seeing this bug even after I've removed everything depending on eslint@4.x from my project.

@Autre31415

This comment has been minimized.

Copy link

commented Sep 18, 2018

Hmm... I think I'm seeing this bug even after I've removed everything depending on eslint@4.x from my project.

Double check those dev dependencies to make sure, then wipe out package-lock.json and node_modules and do a fresh npm install.

@ceefour

This comment has been minimized.

Copy link

commented Sep 23, 2018

I am having this issue on NodeJS 8.11.1 Win64 and my only libs are:

  "dependencies": {
    "@feathersjs/express": "^1.2.7",
    "@feathersjs/feathers": "^3.2.3"
  },
  "devDependencies": {
    "nodemon": "^1.18.4",
    "standard": "^12.0.1"
  }

Is it nodemon ?

My package-lock.json is:

    "eslint": {
      "version": "5.4.0",
      "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz",
      "integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==",
      "dev": true,

so it's not eslint@4 conflict then?

@ceefour

This comment has been minimized.

Copy link

commented Sep 23, 2018

Thanks to @favadi's #1189 (comment). Workaround works for me is:

npm i --save-dev standard@11
@stale

This comment has been minimized.

Copy link

commented Dec 22, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Dec 22, 2018

@stale stale bot closed this Dec 29, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Mar 29, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
8 participants
You can’t perform that action at this time.