Skip to content

npm-start not working anymore #9567

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

Closed
ghost opened this issue Aug 29, 2020 · 1 comment
Closed

npm-start not working anymore #9567

ghost opened this issue Aug 29, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 29, 2020

I have been using create-react app for a long time for my react apps. For the past 2-3 weeks. I have been putting in my terminal npm install and then npm start. Whenever I run npm start, it will always show this

`> [email protected] start C:\Users\raahi\OneDrive\Documents\GitHub\SocialDev-Firebase

react-scripts start

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

"eslint": "^6.6.0"

Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:

C:\Users\raahi\OneDrive\Documents\GitHub\SocialDev-Firebase\node_modules\eslint (version: 5.12.0)

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  1. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
    This may help because npm has known issues with package hoisting which may get resolved in future versions.

  2. Check if C:\Users\raahi\OneDrive\Documents\GitHub\SocialDev-Firebase\node_modules\eslint is outside your project directory.
    For example, you might have accidentally installed something in your home folder.

  3. Try running npm ls eslint in your project folder.
    This will tell you which other package (apart from the expected react-scripts) installed eslint.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

Even when I run the npm scripts on the VSCode sidebar, the same thing happens. Please fix this

@petetnt
Copy link
Contributor

petetnt commented Aug 31, 2020

Hi @ReactHTMLCSS,

As said in the error message, you have multiple or wrong eslint installations in your project tree. This can cause subtle issues due to how Node resolution algorithm works.

Follow the instructions step by step in the error message to fix the issue OR add SKIP_PREFLIGHT_CHECK=true to skip this error all together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant