npm not installing packages on WSL - node.js

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.

Related

Can't install npm packages on create-react-app

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.

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

How to fix npm start errors

I just downloaded a dashboard that uses react.js modules so when get to the dashboards source folder and try to run the command 'npm start' I get the error below:
I tried the following commands but it couldn't work
sudo npm -g uninstall node
npm install node
npm cache clean
sudo npm install -g npm
npm install
npm start
npm ERR! path /home/lamechd/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/lamechd/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/lamechd/.npm/_logs/2019-06-04T09_51_23_106Z-debug.log
NB/ Iam using manjaro Operating System based on archlinux

npm install firebase fails

I'm trying to install firebase ^5.5.0 on my local environment (vagrant/virtualbox with ubuntu 16.0.4 and the newest npm and nodejs)
When I run npm install I get this error:
npm ERR! path
/code/node_modules/grpc/node_modules/mkdirp/node_modules/minimist/package.json.789167206
npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open npm ERR!
enoent ENOENT: no such file or directory, open
'/code/node_modules/grpc/node_modules/mkdirp/node_modules/minimist/package.json.789167206'
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/vagrant/.npm/_logs/2018-09-19T09_14_46_808Z-debug.log
The logs or verbose don't tell me anything other than this. How can I solve this?
I did what #Carlo I deleted the package-lock.json and ran npm install, after auditing all the package I ran npm install firebase prior to funding and some audit fixes.
Maybe after funding or fixing some audits it may have been incompatible with installing firebase.

npm run watch doesn't run: no such file or directory, open '/Users/usr/package.json'

I believe this might be happening because I used brew to install npm; I think I might have two different versions. Here is the error:
npm run watch
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.4.1_1/bin/node" "/usr/local/bin/npm" "run" "watch"
npm ERR! node v5.4.1
npm ERR! npm v3.5.3
npm ERR! path /Users/Nicolas/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/Nicolas/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/Users/Nicolas/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Nicolas/Code/wordpress/wp-content/themes/IMFA-theme/npm-debug.log
I have tried the following:
brew doctor (gives a lot of warnings and doesn't seem to change anything)
brew unlink and re-link (doesn't seem to do anything)
For what it's worth, I uninstalled and re-installed brew recently, and I know there are some unlinked kegs; I see this when I run brew doctor, but I don't know how to resolve it.
Other npm commands still seem to work, like npm install. However, npm run watch, in a directory where I want to compile SCSS, is giving me the error above. Any help is appreciated
I met the same problem npm err no such file or directory, open '/Users/usr/package.json' and I got the solution.
to solve the problem,you need to init your environment,like $ xxx init ,then use npm install to install the dependences.

Resources