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

Error: Cannot find module 'babel-eslint' Referenced from: mypath/testing-create/package.json #275

Closed
Lakston opened this issue Jul 29, 2016 · 4 comments

Comments

@Lakston
Copy link

Lakston commented Jul 29, 2016

node v6.3.1
create-react-app v0.2

When opening App.js or index.js in Atom I get this error :

Error: Cannot find module 'babel-eslint' Referenced from: /Users/Home/github/testing-create/package.json

at Object.ModuleResolver.resolve (/usr/local/lib/node_modules/eslint/lib/util/module-resolver.js:75:19)
at load (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:519:42)
at /usr/local/lib/node_modules/eslint/lib/config/config-file.js:392:36
at Array.reduceRight (native)
at applyExtends (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:363:28)
at Object.load (/usr/local/lib/node_modules/eslint/lib/config/config-file.js:531:22)
at loadConfig (/usr/local/lib/node_modules/eslint/lib/config.js:64:33)
at new Config (/usr/local/lib/node_modules/eslint/lib/config.js:197:38)
at CLIEngine.executeOnText (/usr/local/lib/node_modules/eslint/lib/cli-engine.js:750:28)
at Object.cli.execute (/usr/local/lib/node_modules/eslint/lib/cli.js:181:36)

I ran an npm run eject and the babel-eslint folder is in my node_modules folder.

If any other infos are needed feel free to ask me to add them here.

EDIT : looks like I needed to instal babel-eslint globally on my computer, I'm not sure how we could warn new users (like me) about this since this tool is made for them.

@Lakston Lakston closed this as completed Jul 29, 2016
@gaearon
Copy link
Contributor

gaearon commented Jul 29, 2016

This is mentioned in the generated project README.

Unfortunately we can't warn everyone about this because we can't guess if you are using editor plugins for linting or not.

Linting in terminal works fine without global installations.

Also, this problem should be fixed within a couple of months by ESLint itself so it's probably not too bad.

@antoinegrant
Copy link

@gaearon Can't that be fixed by specifying the parser in config/eslint.js like so parser: require.resolve('babel-eslint'), ? This change worked fine for me using Atom.

@gaearon
Copy link
Contributor

gaearon commented Sep 8, 2016

This will only fix parser but won’t fix the same issues with plugins.
The real fix for this will be eslint/eslint#3458.

@antoinegrant
Copy link

Got it! Thanks for the clarification.

@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants