How to resolve npm error: npm start not working - npm

i am trying to install "npx create-react-app new" it successfully installs, however "npm start" shows error:
PS D:\react project\new> npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\react project\new/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\react project\new\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! C:\Users\user\AppData\Local\npm-cache\_logs\2022-03-15T08_51_51_601Z-debug.log
PS D:\react project\new>
I checked my package.json, it looks fine, anyone can suggest whats the issue here?

First of all run:
npm run start
if it did not work then delete the node-module folder and use
npm i or npm install
this will work for you.

Related

Why am I getting errors with npx?

everytime when I run any npx command it gives me the same error.
Except when I run: npx -v then it gives me the version: 9.2.0
here is the error:
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path E:\Development
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'E:\Development'
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\Tim\AppData\Local\npm-cache\_logs\2023-01-02T20_03_57_627Z-debug-0.log
I have updated npm with nvm but that didnt make a change.
I want to run npx create-react-app myApp or npx create-electron-app myApp but every command gives me the same error.
Can somebody help me to get rid of this error ?
I think you are facing the issue because your using an capital letter.
Try this npx create-react-app my-app

I am unable to install npm package

I have made an empty folder and trying to install the npm package inside the folder so I can start to write an application. I have been attempting to install package JSON with npm install -y but it only installs the package-lock-JSON but it's showing me the following error. I even reinstalled the node on my PC didn't work.
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\hasan\Desktop\Githubfiles\node _express_mongodb/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\hasan\Desktop\Githubfiles\node _express_mongodb\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! C:\Users\hasan\AppData\Local\npm-cache_logs\2022-12-06T12_18_28_964Z-debug-0.log
PS C:\Users\hasan\Desktop\Githubfiles\node _express_mongodb>

i get error when i run sudo npm run serve

I was getting error when i was installing npm but it seemed to me that it run fine. I created default app and i tried sudo npm run serve but i get this error
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/00/00/00/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/00/00/00/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
I tried:`npm cache clear` & `sudo npm cache clear` and i get error starting with As of npm#5, the npm cache self-heals from corruption issues.
NPM VERSION 8.18.0
Fixed it, i needed to add package.json file to my app.

Error reading tmp file/directory when using NPM to include a GIT only package

I am trying to include the GIT package https://github.com/Denglo/bs5-autocomplete-vanillaJS.git into my (simple) project. This currently only has two other packages:
"dependencies": {
"bootstrap": "latest",
"bootstrap-icons": "latest"
}
Running a npm install with the above works without an issue, but when I run any of the following
npm install git+https://github.com/Denglo/bs5-autocomplete-vanillaJS.git
or
npm install https://github.com/Denglo/bs5-autocomplete-vanillaJS.git
or
npm install github:Denglo/bs5-autocomplete-vanillaJS
I get the following error:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path ~/.npm/_cacache/tmp/git-cloneHYQNgb/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '~/.npm/_cacache/tmp/git-cloneHYQNgb/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! ~/.npm/_logs/2022-07-22T09_37_33_747Z-debug-0.log
The ~/.npm/_cacache/tmp directory exists and the user has full access to it. The error log does not says the same as above. I also tried to manually add the line to the package.json, but that resulted in the same error.
Any ideas how I can solve this?

npm start isn't working in new React apps?

I've removed and reinstalled NPM and Node, still no fix. Here's the error code after I create-react-app and input npm start.
npm ERR! syscall open
npm ERR! path /Users/carriepresley/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/carriepresley/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent```
Use cd to the directory where package.json is located and then run the npm start command. This will work.