The error I'm getting is like this:
vaibhav#Knighthood MINGW64 ~/Desktop/Coding NInja/tool (master)
$ npm start
> tool#0.1.0 start C:\Users\vaibhav\Desktop\Coding NInja\tool
> 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:
"webpack": "4.42.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:
C:\Users\vaibhav\node_modules\webpack (version: 4.44.1)
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 "webpack" 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\vaibhav\node_modules\webpack is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls webpack in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed webpack.
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! tool#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tool#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\vaibhav\AppData\Roaming\npm-cache\_logs\2020-09-01T10_23_38_476Z-debug.log
I have tried to fix the dependency tree by the suggested steps:
Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "webpack" from dependencies and/or devDependencies in the
package.json file in your project folder.
Run npm install or yarn, depending on the package manager you use.
But I'm still facing the same error.
My system configurations are:
Node -v : 12.18.3
npm -v : 6.14.8
OS : Windows 10 pro v2004 H1 x64
Related
> new-app#0.1.0 start C:\Users\sachin\reactjs\new-app
> 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\sachin\node_modules\eslint (version: 7.10.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:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
6. Check if C:\Users\sachin\node_modules\eslint is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. 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! new-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the new-app#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\sachin\AppData\Roaming\npm-cache\_logs\2020-10-09T06_26_24_453Z-debug.log
If nothing works, try deleting node_modules in one directory back from your project.
Somehow I had node_modules in user/devdirectory, not in user/devdirectory/project
I am getting this error while running npm start on my CRA app. I tried uninstalling and installing webpack. Only thing that works is,
creating a ".env" file at the root with SKIP_PREFLIGHT_CHECK=true.
`
hello#0.1.0 start C:\Users\USER\Desktop\MyReact\REACT_HOOKS\hello
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:
"webpack": "4.42.0"
Don't try to install it manually: your package manager
does it automatically.
However, a different version of webpack was detected higher up in the tree:
C:\Users\USER\node_modules\webpack (version: 4.43.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:
Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
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:
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.
Check if C:\Users\USER\node_modules\webpack is outside your project directory.
For example, you might have accidentally installed something in your home folder.
Try running npm ls webpack in your project folder. This will tell you which other package (apart from the expected react-scripts) installed webpack.
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! hello#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hello#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
`
Ok, I ran npm uninstall -g webpack it didn't do anything.
then I ran both
npm uninstall -g webpack
npm uninstall webpack
and it's not showing the error anymore.
so apparently
npm uninstall webpack
worked.
Probably the issue was caused by a manual download of webpack.
I ran npm uninstall webpack, delete package.lock.json, and then run yarn.
If you prefer npm, then instead of running yarn , you run npm install.
This will re-install webpack the right way in the dependency tree.
I was trying to make video conferencing using React, but after installing npm start isn't working. It is showing this in my terminal:
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-eslint": "10.1.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of babel-eslint was detected higher up in the tree:
C:\Users\Vatsal\node_modules\babel-eslint (version: 10.0.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 "babel-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:
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\Vatsal\node_modules\babel-eslint is outside your project directory.
For example, you might 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 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! voom#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the voom#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\Vatsal\AppData\Roaming\npm-cache\_logs\2020-07-29T14_00_29_296Z-debug.log
What I did was that I tried to install webpack globally. I also tried a few suggestions from the Internet and what was suggested in the terminal but nothing helped.
Just follow the exact instructions given in the error log:
To fix the dependency tree, try following the steps below in the exact
order:
Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "babel-eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
Run npm install or yarn, depending on the package manager you use.
I create private npm registry with verdaccio.
I want to able to run npm install --registry="http://localhost:4873" and get all dependencies from private registry.
I need to publish all packages from my project node_modules directory.
I had to run npm publish in each package in node_module directory.(I could't find any better way.)
more of them published successfully But in some case, I encountered with the error. for example in zone.js package:
npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! zone.js#0.8.29
prepublish: `tsc && gulp build` npm ERR! Exit status 2 npm ERR! npm
ERR! Failed at the zone.js#0.8.29 prepublish script. npm ERR! This is
probably not a problem with npm. There is likely additional logging
output above. npm WARN Local package.json exists, but node_modules
missing, did you mean to install?
or in acorn package:
acorn#5.7.3 build:main C:\Users\Admin\Desktop\test ng\ng-prj\node_modules\acorn
rollup -c rollup/config.main.js
'rollup' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! acorn#5.7.3 build:main: `rollup -c rollup/config.main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the acorn#5.7.3 build:main script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
Is there a simple way of doing this?
here Verdaccio maintainer.
I want to able to run npm install --registry="http://localhost:4873" and get all dependencies from private registry.
What do you want is to have an offline registry with all your dependencies. Publish all node_modules is not practical and almost impossible.
more of them published successfully But in some case, I encountered with the error. for example in zone.js
That's the point, you would need to build each dependency, it just does not make sense. A regular project can easily have thousands of dependencies and sub dependencies. Not to mention you would lose the adventage of future dependencies updates.
So, what you need is cache properly all dependencies in your storage folder.
Run verdaccio $> verdaccio
Be sure you are online
Run npm install --registry="http://localhost:4873
When the finish to install, inspect your local cache, see here how to find it. You should be able to see all the resolved dependencies in the cache.
If you want a real offline experience, comment the proxy from the config file as follows
packages:
'#*/*':
access: $all
publish: $authenticated
# proxy: npmjs
'**':
access: $all
publish: $authenticated
# proxy: npmjs
If you comment out proxy Verdaccio won't ask for any update to the remotes, by default is npmjs, thus, no connection to external networks will be performed.
Restart Verdaccio
Repeat process as much time you need.
So, here, the advantages of this approach.
When yo back offline (you must comment out the proxy section again) you will allow Verdaccio to resolve wether you have new dependencies to be cached (in case you are using semver eg: lodash: ^1.5.6)
You will have a real installation experience, no fear to remove node_modules and clean the npm cache as well.
Storage is just a folder, so you can port it to another place (via USB or LAN)
Share cache with multiple projects and node package manager tools (yarn, npm or pnpn)
You don't have to publish each package in node_modules, thus see point 2).
I hope this helps you. Furthermore, there are other practices related with offline mode, but only with yarn.
We used Juan Picado's advice above. Here's what we did:
edit verdaccio's config file at /home/verdaccio/config.yaml
make sure that proxying is allowed
set the npm registry to point to your verdaccio instance
create a folder (any folder) on the system and run npm install commands to download packages
check the /home/verdaccio/storage/ directory. The downloaded packages plus their dependencies should now be in that directory.
edit verdaccio's config file, commenting out the two "proxy" lines so that proxying is turned off
restart verdaccio
At this point running npm install commands will only point to your verdaccio instance without going out to registry.npmjs.com and the packages in /home/verdaccio/storage will be your offline-available packages.
So whenever I run npm start in my React project it gives me this error:
myapp#0.1.0 start C:\Users\AyaLe\Desktop\React\myapp 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:
"webpack": "4.19.1"
Don't try to install it manually: your package manager does it
automatically. However, a different version of webpack was detected
higher up in the tree:
C:\Users\AyaLe\node_modules\webpack (version: 3.10.0)
Manually installing incompatible versions is known to cause
hard-to-debug issues.
If 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:
Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
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:
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.
Check if C:\Users\AyaLe\node_modules\webpack is outside your project directory.
For example, you might have accidentally installed something in your home folder.
Try running npm ls webpack in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed webpack.
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! myapp#0.1.0 start:
react-scripts start npm ERR! Exit status 1 npm ERR! npm ERR! Failed
at the myapp#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\AyaLe\AppData\Roaming\npm-cache_logs\2018-12-02T10_15_24_630Z-debug.log
Also whenever I try to install webpack-cli whenever it asks me to, it gives me another error
It looks like you have "webpack": "3.10.0" installed globally, but you need to have "webpack": "4.19.1". This is causing a conflict.
You need to do the following:
1. $npm uninstall -g webpack
2. $npm install -g webpack#4.19.1
This should solve the issue.
Alternatively, you can try deleting the node_modules folder or specifically the webpack folder in node_modules at the location:
C:\Users\AyaLe\node_modules\webpack (version: 3.10.0)
It seems that you have an incorrect version of 'webpack' installed. Check your package.json file to ensure that you have the correct 'webpack' version.
The file should look like something this :
{
... ,
"dependencies" : {
...,
"webpack" : "<version number>"
}
}
Ensure that the version number is exactly 4.19.1. This will ensure that you install the specific version of webback.
Once you change/update your package.json, try deleting node_modules/ directory and then running npm install in the same directory as your package.json is.