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

Global standard doesn't find global babel-eslint since version 13 #1328

Open
tsujigiri opened this issue Jul 12, 2019 · 5 comments

Comments

@tsujigiri
Copy link

commented Jul 12, 2019

What version of standard?
13.0.1
What operating system, Node.js, and npm version?
Arch Linux (locally) and Docker image circleci/ruby:2.5.3-node-browsers.
Node: 11.15.0
npm: 6.10.0
babel-eslint: 10.0.2
What did you expect to happen?
npm install -g standard babel-eslint to install compatible versions of both.
What actually happened?
Running standard --parser babel-eslint [files] throws an error:

standard: Unexpected linter output:

Error: Failed to load parser 'babel-eslint' declared in 'CLIOptions': Cannot find module 'babel-eslint'
Require stack:
- /home/helge/code/combostrike/backoffice/__placeholder__.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
    at Function.resolve (internal/modules/cjs/helpers.js:19:19)
    at Object.resolve (/home/helge/.node_modules/lib/node_modules/standard/node_modules/eslint/lib/shared/relative-module-resolver.js:44:50)
    at ConfigArrayFactory._loadParser (/home/helge/.node_modules/lib/node_modules/standard/node_modules/eslint/lib/cli-engine/config-array-factory.js:752:45)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/home/helge/.node_modules/lib/node_modules/standard/node_modules/eslint/lib/cli-engine/config-array-factory.js:550:32)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/home/helge/.node_modules/lib/node_modules/standard/node_modules/eslint/lib/cli-engine/config-array-factory.js:491:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at createConfigArray (/home/helge/.node_modules/lib/node_modules/standard/node_modules/eslint/lib/cli-engine/config-array-factory.js:307:25)
    at ConfigArrayFactory.create (/home/helge/.node_modules/lib/node_modules/standard/node_modules/eslint/lib/cli-engine/config-array-factory.js:362:16)

If you think this is a bug in `standard`, open an issue: https://github.com/standard/standard/issues

Workaround
Installing standard version <13 works fine.

Edit: Added the name of the Docker image we use in our CI.

@feross

This comment has been minimized.

Copy link
Member

commented Jul 12, 2019

Thanks for the issue. There is a bug right now where standard doesn't work when installed globally. Looking into it now.

@feross

This comment has been minimized.

Copy link
Member

commented Jul 12, 2019

This should be fixed in standard 13.0.2.

@feross feross added the bug label Jul 12, 2019

@feross feross closed this Jul 12, 2019

@tsujigiri

This comment has been minimized.

Copy link
Author

commented Jul 15, 2019

Unfortunately, I still get the same error, on CI and locally. 😬

@feross feross reopened this Jul 29, 2019

@feross feross added this to the standard v14 milestone Jul 29, 2019

@feross

This comment has been minimized.

Copy link
Member

commented Aug 15, 2019

ESLint 6 changed the way that parsers and plugins are resolved. They must now be installed locally in your project, even if standard is installed globally. It's an unfortunate change.

@feross

This comment has been minimized.

Copy link
Member

commented Aug 15, 2019

This may be fixed if we adopt the babel-eslint parser by default as I proposed in #1356

@feross feross modified the milestones: standard 14, standard 15 Aug 15, 2019

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