Can not run React App after cloning it from Github - javascript

I really need your help. I would be highly appreciated.
I clone this project : https://github.com/iearn-finance/iearn-finance,
and I want to have a front-end website like this: https://yearn.finance/.
But I can not run it locally. I have tried "npm install" and then "npm start", check package.json carefully but it still does not work and gave me this error:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\iearn-finance-develop\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\iearn-finance-develop\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

1- are you sure path D:\iearn-finance-develop is correct??
isn't D:\iearn-finance ??
2-did you :
delete package-lock.json and node_modules and then npm install
3-check on your filesystem if the file exists.
try these :
npm cache clean
you should initialize package with :
npm init
then install your packages

Try cleaning the cache with npm cache clean
Then initialize with npm init
After that, install your packages.
It worked for mine.

Related

npm ERR! errno -4058 while running npm run start-rewired

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.

npm ERR A complete log of this run can be found in

I was watching a tutorial on sass and I got stuck in this part , im not familiar with npm,nodejs and stuff so idk what i should do !? can u take a look and see why i cant install node-sass?
PS D:\NODE-SASS> npm install node-sass
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "node-sass" under anpm ERR! also called "node-sass". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR! <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\bla blabla_25_42_696Z-debug.log
PS D:\NODE-SASS> npm install node-sass
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "node-sass" under a package
npm ERR! also called "node-sass". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR! <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>
npm ERR! A complete log of this run can be found in:
npm ERR! c:/bla bla bla
This text clearly states that you gave the same name to your project in package.json as the name of this package.
also called "node-sass". Did you name your project the same
npm ERR! as the dependency you're installing?
Rename your project in package.json and maybe a folder itself not to confuse it with this package
You should rename your project name in package.json file and try again. install package that you want to install. All of them must be OK

npm start throwing error 'This is related to npm not being able to find a file.'

I just created a react app, it was working fine but once I restart the editor it is throwing error like this :
Poojas-MacBook-Air:newreact pooja$ npm start
npm ERR! path /Users/pooja/Desktop/projects/newreact/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open
'/Users/pooja/Desktop/projects/newreact/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/pooja/.npm/_logs/2020-11-28T10_27_42_118Z-debug.log
Please help if anyone knows about it.
Make sure you have the latest npm (npm install -g npm).
Add an exception to your antivirus to ignore the node_modules folder in your project.
rm -rf node_modules package-lock.json
npm install
Sometimes the PATH is not correct, just open the cmd and cd to the address where the package.json is and then run npm start
For me, it was because of the running Metro server. If anyone is experiencing this issue in react-native, make sure you have stopped the running Metro server instance before entering npm i <package-name>.
With yarn, I think, there's no such issue.
To resolve package.json file, go to your project folder and find package.json location folder.
Open terminal and make sure your are in correct path where package.json file located.
eg: c://projectfolder/folder1/clientapp> npm start

npm ERR! Object for dependency "fsevents" is empty

I am getting folowing error while installing anything through npm. Kindly help me with it.
premnath#premnath-Inspiron-5559:~$ sudo npm install -g #angular/cli
[sudo] password for premnath:
npm ERR! Object for dependency "fsevents" is empty.
npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install".
npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap".
npm ERR! A complete log of this run can be found in:
npm ERR! /home/premnath/.npm/_logs/2020-10-15T07_45_49_290Z-debug.log
premnath#premnath-Inspiron-5559:~$
node version : v12.19.0
npm version : 6.14.8
ERR! Something went wrong. Regenerate the package-lock.json with "npm
install"
Clear out node_modules folder and package-lock.json and run npm i

when running npm start, to start a react project I get the following messages on the terminal

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.

Categories

Resources