1

Terminal

npm start

> matchstatz@0.1.0 start C:\Users\07\OneDrive\Desktop\matchstatztask\matchstatz
> 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:

  "babel-loader": "8.1.0"

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

  C:\Users\07\node_modules\babel-loader (version: 8.0.6)

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 "babel-loader" 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:

  5. 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.

  6. Check if C:\Users\07\node_modules\babel-loader is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

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

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! matchstatz@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the matchstatz@0.1.0 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\07\AppData\Roaming\npm-cache\_logs\2020-06-03T18_01_06_704Z-debug.log

debug log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v12.17.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle matchstatz@0.1.0~prestart: matchstatz@0.1.0
6 info lifecycle matchstatz@0.1.0~start: matchstatz@0.1.0
7 verbose lifecycle matchstatz@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle matchstatz@0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\07\OneDrive\Desktop\matchstatztask\matchstatz\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk-12.0.2\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\07\.windows-build-tools\python27\;C:\Users\07\AppData\Local\Microsoft\WindowsApps;C:\Users\07\AppData\Local\GitHubDesktop\bin;C:\Users\07\AppData\Roaming\npm
9 verbose lifecycle matchstatz@0.1.0~start: CWD: C:\Users\07\OneDrive\Desktop\matchstatztask\matchstatz
10 silly lifecycle matchstatz@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle matchstatz@0.1.0~start: Returned: code: 1  signal: null
12 info lifecycle matchstatz@0.1.0~start: Failed to exec start script
13 verbose stack Error: matchstatz@0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid matchstatz@0.1.0
15 verbose cwd C:\Users\07\OneDrive\Desktop\matchstatztask\matchstatz
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.17.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error matchstatz@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the matchstatz@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

**Here in above details, i've created reactjs app using npx create-react-app appname but after getting into directory using cd command, if I give npm start means I'm getting this kind of errors. I have pasted the debug log and Terminal error here. And getting error details as "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." **

jeevan kotian
  • 137
  • 2
  • 12
  • Does this answer your question? [NPM start returns error, "There might be a problem with the project dependency tree"](https://stackoverflow.com/questions/56528222/npm-start-returns-error-there-might-be-a-problem-with-the-project-dependency-t) – Henke Mar 12 '22 at 16:44

2 Answers2

1

You should remove /Users/nameOfYourComputer/node_modules, as this seems to be your root directory and you generally shouldn't have node_modules there.

It's been one day, I'm trying to figure it out, I tried the above instructions but nothing until I found this solution in reddit.

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • I was struggling with this for 2 days and finally the solution provided by you did the trick! – Kamil May 22 '21 at 11:13
0

Sometime back i faced the same issue and I followed the same steps as mention below.

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 "babel-loader" 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.
njain
  • 147
  • 3
  • 7