Home > front end >  Reactjs NPM start wrong solution
Reactjs NPM start wrong solution

Time:12-12

D: \ vuedemo \ day23 \ react - study> NPM start

[email protected] start D: \ vuedemo \ day23 \ react - study
The react - scripts start


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

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

"Babel - eslint" : "10.1.0
"
Don 't try to install it manually: your package manager does it automatically.
Or, a company's version of Babel - eslint was detected who up in the tree:

D: \ node_modules \ Babel - eslint (version: 7.2.3)

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

If you order -- to ignore this check, the add SKIP_PREFLIGHT_CHECK=true to the an. Env file in your project.
That will permanently disable this message but you took encounter other issues.

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

1. Delete package - lock. Json (not package. The json!) And/or yarn. Lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "Babel - eslint" from dependencies and/or devDependencies in the package. The 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 from from, there are what other things you can try:

5. If you informs the NPM, install yarn (http://yarnpkg.com/) and repeat the above steps with it home.
This may help because NPM has known issues with the package hoisting which may get resolved in future versions.
6. Check if the D: \ node_modules \ Babel - eslint is outside your project directory.
For example, you took have accidentally installed something in your home folder.

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

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

P.s. We know this message is long but both 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! The 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.

npm ERR! A complete log of this run can be found in:
npm ERR! C: \ Users \ \ Administrator \ AppData \ Roaming \ NPM - cache \ _logs \ 2020-07-08 T09_02_50_542Z - the debug log

In the root directory to create a. Env file as shown in figure:

Fill in the following code inside, complete the restart can

The hope can help you,,
  • Related