I run my React app using npm using the following command npm run start-rewired.
However, in doing so, I'm getting the below error:
> project#0.1.0 start-rewired
> react-app-rewired start
npm ERR! code ENOENT
npm ERR! syscall spawn C:\Program Files\git\bin\bash.exe
npm ERR! path C:\project
npm ERR! errno -4058
npm ERR! enoent spawn C:\Program Files\git\bin\bash.exe ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\{my-user}\AppData\Local\npm-cache\_logs\2022-03-16T15_34_33_074Z-debug-0.log
I have followed a lot of the suggestions online, including deleting the node_modules as well as clearing the npm cache using npm cache clean
I'm running npm run start-rewired in the root path of my project. I should mention that I use yarn to install the dependencies and packages, and that running yarn install worked fine.
I'm really stuck and I'm unsure on what to do at this point.
EDIT I should also mention that this project starts up fine on a different machine with the same node and npm versions.
This issue was due to the fact that npm couldn't find the bash.exe location for git. It was looking here C:\Program Files\git\bin\bash.exe but git was installed in a different location. So what I did was uninstall and reinstall git in the above location and it resolved the issue.
Related
I have been trying to download a template to start customizing it. Upon downloading it, one is supposed to install all local dependencies using npm install or yarn install. I have done both of those and I have gotten the same error both times. Moreover I have tried using the same command with --force and --legacy-peer-deps, as advised in the error message. I found a GitHub issue discussing this precise problem and some other stack overflow threads. I have tried everything I have come across, and it is just not working. Moreover I have installed the recommended version of node, so that is not the problem either, as suggested in a different thread.
The error message can be seen below.
While resolving: #mui/material#5.2.0
npm ERR! Found: #emotion/react#11.4.1
npm ERR! node_modules/#emotion/react
npm ERR! #emotion/react#"11.4.1" from the root project
npm ERR! peer #emotion/react#"^11.0.0-rc.0" from #emotion/styled#11.3.0
npm ERR! node_modules/#emotion/styled
npm ERR! #emotion/styled#"11.3.0" from the root project
npm ERR! peerOptional #emotion/styled#"^11.3.0" from #mui/material#5.2.0
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"5.2.0" from the root project
npm ERR! 1 more (#mui/icons-material)
npm ERR! 1 more (#mui/styled-engine)
npm ERR! 1 more (#mui/styled-engine)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional #emotion/react#"^11.5.0" from #mui/material#5.2.0
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"5.2.0" from the root project
npm ERR! peer #mui/material#"^5.0.0" from #mui/icons-material#5.2.0
npm ERR! node_modules/#mui/icons-material
npm ERR! #mui/icons-material#"5.2.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #emotion/react#11.7.1
npm ERR! node_modules/#emotion/react
npm ERR! peerOptional #emotion/react#"^11.5.0" from #mui/material#5.2.0
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"5.2.0" from the root project
npm ERR! peer #mui/material#"^5.0.0" from #mui/icons-material#5.2.0
npm ERR! node_modules/#mui/icons-material
npm ERR! #mui/icons-material#"5.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
The template: https://www.creative-tim.com/product/material-dashboard-react?ref=readme-mdr#
GitHub issue: https://github.com/creativetimofficial/material-dashboard-react/issues/171
Thanks in advance.
The problem is that the specific version of #emotion/react used in the template, is not working anymore.
To solve the problem I went to the package.json and changed the version from 11.4.1 to 11.5.0 manually. Seems that the 11.5.0 solves the problem with the template used.
upgrade your version from package.json file and run again "npm install" command
I received this error while not in the folder of my react app. Cd into it and should be good but I am positive you found this answer by now or stumbled upon it like me. Best wishes
Can someone help. I am completely new to this but when I am running the script I am getting below error. if someone can teach me or help me it would be a great help
functions# deploy /Users/kapilgaur/Downloads/React-Native-APP-master/functions
firebase deploy --only functions
sh: firebase: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! functions# deploy: `firebase deploy --only functions`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the functions# deploy 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?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kapilgaur/.npm/_logs/2020-03-05T13_09_05_478Z-debug.log
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
run this in your terminal
alias firebase="`npm config get prefix`/bin/firebase"
or you just install firebase tool globally
npm install -g firebase-tools
either of them should do the trick,
When running npm start, to start a react project I get the following messages on the terminal:
npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /Users/eraldomaia/package.json npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, open '/Users/eraldomaia/package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
npm ERR! A complete log of this run can be found in: npm ERR! /Users/eraldomaia/.npm/_logs/2020-02-29T15_23_08_741Z-debug.log
I do not know what to do!
How can I solve this?
You have to run npm start at root folder of your project (where de package.json resides).
This is because npm is unable to find package.json in the directory where you are running npm start. Make sure your current working directory is the one where the project is actually cloned / bootstrapped.
I transferred a ReactJS + NodeJS project from another computer to a new computer. Then inside the folder, I did npm install in the terminal but getting the following response back.
> fsevents#1.0.14 install /Users/Joshua/Projects/practice_project/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/Joshua/Projects/practice_project/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
And on the previous computer, I ran the project via npm run server, but when I do it after npm run server in the project on the new computer, now I am getting:
> practice_project#1.0.0 serve /Users/Joshua/Projects/practice_project
> nodemon server/server.js --ignore components
sh: nodemon: command not found
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "serve"
npm ERR! node v4.6.1
npm ERR! npm v2.15.9
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! practice_project#1.0.0 serve: `nodemon server/server.js --ignore components`
npm ERR! spawn ENOENT
I looked around but can't seem to find the right solution. Tried npm install -g node-gyp but getting tar.unpack untar error.
What could be the issue? Will upvote and accept the answer. Thank you.
In this case, the first message you received is just telling you it's attempting to rebuild the fsevents package for your environment, then realized it already had it built, so stopped the process.
The second message is indicating that you are attempting to run nodemon but it isn't installed. I would hazard a guess that it was installed globally on your previous machine (and therefore not included in the project's package.json). If you want to install it globally again, you'll need to run npm i -g nodemon.
I have node.js installed on my machine, I have version: v0.12.0 installed. Following instructions when I use sudo npm install I get these errors:
npm ERR! install Couldn't read dependencies
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.0
npm ERR! npm v2.6.0
npm ERR! path /Users/aston.haigh/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -2
npm ERR! package.json ENOENT, open '/Users/aston.haigh/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/aston.haigh/Projects/astonhaigh.co.uk/npm-debug.log
Ive tried clearing the node cache, updating node and havent had any luck, any ideas?
Seem to fix the issue when i uninstalled node and then reinstall using homebrew. P.s really good tutorial: https://www.youtube.com/watch?v=FqMIyTH9wSg