Can't install npm packages on create-react-app - node.js

I wanted to work on a project so I used npx create-react-app app-name. I got an error call back err!, I did some research and I was told to update npm. By typing npm update #latest. Then it lead to another issue
npm Err! code ENOENT
npm ERR! syscall spawn bash
npm ERR! path C:\Users\DELL\Documents\react-expenses-tracker
npm ERR! errno -4058
npm ERR! enoent spawn bash ENOENT
npm ERR! enoent This is related to npm not being able to find a file
npm ERR! enoent
I have deleted node js and installed it again.
Usually if I have issues like this y used to type npm cache clean --force and everything will work fine again but now it shows a warning .
Edit: My OS is Windows.

Related

I am trying to create a react app but it gives this error

$ npx create-react-app my-app
npm ERR! code ENOENT
npm ERR! syscall spawn C:\MongoDb\mongosh-1.0.1-win32-x64\mongosh-1.0.1-win32-x64\bin
npm ERR! path C:\Arya\web development\react-project-first
npm ERR! errno -4058
npm ERR! enoent spawn C:\MongoDb\mongosh-1.0.1-win32-x64\mongosh-1.0.1-win32-x64\bin 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\yoges\AppData\Local\npm-cache\_logs\2021-08-20T17_12_07_619Z-debug.log
My node and npm versions are up to date.
I tried reinstalling npm and tried installing a module to make sure it is working but it's showing the same error.
And in my package.json when I click debug this is what it shows:
Can someone tell me what to do?
you should uninstall it.
npm uninstall -g create-react-app.
and then try again, it happens sometimes if you have an old version installed.
Never mind, it started working again. The path of the ComSpec was changed for some reason and also in the environment variables the MongoDB was messing so had to delete that too.

Trying to set up Angular application for the first time

I am having issues trying to get an angular framework setup to start a new project, and having some challenges. I installed node.js and as you can see I have v14.17.1 installed. when I try the command npm -g #angular/cli i get some errors that I don't know how to fix. Not sure what my next steps should be to help get this working. thanks.
C:\Users***\Documents\Codding\Angular>node -v v14.17.1
C:\Users*\Documents\Codding\Angular>npm -g #angular/cli npm ERR!
code ENOENT npm ERR! syscall open npm ERR! path
C:\Users*\Documents\Codding\Angular/package.json npm ERR! errno
-4058 npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users***\Documents\Codding\Angular\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***\AppData\Local\npm-cache_logs\2021-06-23T11_15_18_924Z-debug.log
cmd promt errors
You have left out the "install" part of the npm command.
Try
npm install -g #angular/cli
Then, once that finishes, you can verify by running
ng version

unable to run the react project- the following error enoent ENOENT

Whenever I am running npm start in my project it displays the following error
npm ERR! code ENOENT npm ERR! syscall open npm ERR! path
/home/abhi/package.json npm ERR! errno -2 npm ERR! enoent ENOENT: no
such file or directory, open '/home/abhi/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!
/home/abhi/.npm/_logs/2020-12-17T04_15_31_411Z-debug.log
abhi#Abhi:~/Projects/demo1$
I tried everything to fix the issue but did not find a solution.
what I am missing in JSON.package ??
You need to navigate to your app directory to be able to run npm start.
seems you are running it out of that directory.
type
cd "your app path"
then
npm start
is your package initialised at all? did you run
npm init
or your dependencies and their versions are correct? and the node version too?
Clear everything from the cache and try installing again
npm cache clean

Getting error while installing node packages with npm

At the end, the package is installed successfully, but I have to retry several times before the installation is done. It doesn't matter what package or if it is global or local.
The messages are as follow:
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\david\Dropbox\www\Javascript\nodeuseapi\node_modules\grunt-contrib-uglify
npm ERR! dest C:\Users\david\Dropbox\www\Javascript\nodeuseapi\node_modules\.grunt-contrib-uglify.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\david\Dropbox\www\Javascript\nodeuseapi\node_modules\grunt-contrib-uglify' -> 'C:\Users\david\Dropbox\www\Javascript\nodeuseapi\node_modules\.grunt-contrib-uglify.DELETE'
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\david\AppData\Roaming\npm-cache\_logs\2020-09-09T08_30_20_853Z-debug.log
In this case, it was grunt-contrib-uglify, but it could have been any other package.
It also doesn't seem to matter whether if I install from cmd with admin privileges or from VS Code terminal.
I'm under windows 10. Node is v12.18.3. Npm is 6.14.8.
Thank you for any help you can provide on the matter.

npm not installing packages on WSL

I keep running into an issue with npm not installing packages.
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /mnt/c/Users/zhelf/downloads/test/node_modules/ansi-regex
npm ERR! dest /mnt/c/Users/zhelf/downloads/test/node_modules/.ansi-regex.DELETE
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/mnt/c/Users/zhelf/downloads/test/node_modules/ansi-regex' -> '/mnt/c/Users/zhelf/downloads/test/node_modules/.ansi-regex.DELETE'
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! /home/zhelf/.npm/_logs/2020-08-05T16_06_33_155Z-debug.log
this is the error it keeps giving me I am running windows 10 with WSL and ubuntu 20.04 I have tried through the regular terminal and the terminal in vscode as well. I have tried googling the problem have cleared the npm cache and I get the same problem I was trying to install express but tried other packages as well and I keep getting the same error.
Ok, I found the issue I needed to run the npm install -g build-tools, and package install it again.

Resources