npm install error web project - node.js

When I try install npm modules I see the following problem:
PS C:\Users\maxzag\Desktop\svoi> npm install
npm ERR! Cannot read property '0' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\maxzag\AppData\Roaming\npm-cache\_logs\2017-08-15T11_25_41_473Z-debug.log
Can someone already come across this problem and can something advise?

This might be your issue: https://github.com/npm/npm/issues/17858
Try removing node_modules and running npm install again.

Related

uninstalling broken node packages for react native

I am working on a react native app and I had to install node and expo-cli to start the app but recently I have been having issues with running the app. When I run npm start, I get the error expo: command not found so I install the expo-cli using npm install --global expo-cli I get this error:
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /Users/{usr}/.npm-global/lib/node_modules/expo-cli
npm ERR! dest /Users/{usr}/.npm-global/lib/node_modules/.expo-cli-F3yBqKce
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 501:20 "/Users/{usr}/.npm"
I ran the sudo chown -R 501:20 "/Users/{usr}/.npm command but it still does not work.
So I tried to uninstall node and start all over but the issue still persists. Does anyone know a way to fix these issues? Like is there a way I can reset my packages or something like that?
Thanks in advance!

npm install always gives 'Your cache folder contains root-owned files, due to a bug in npm previous versions of npm which has since been addressed.'

I am currently using Ubuntu 18.04.4 and I am trying to install something using npm install but it always gives the error below. I tried other aliases as well (npm i, npm add) but the error persists.
npm install
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path /home/dell/.npm/_cacache/content-v2/sha512/14/21/2143fe2b135cd8bfdad85c9c3f9ac46ab279a58dee631cfea1b9678167bd388d44f2d36739019c96ba3a4c4756b1ea6570f4dc8931fb8ad8230359521f80
npm ERR! errno -1
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1001:1001 "/home/dell/.npm"
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dell/.npm/_logs/2020-07-30T17_16_58_257Z-debug.log
When I run the sudo chown -R 1001:1001 "/home/dell/.npm" command, it does nothing, and the error remains when I run npm install again. I have also searched StackOverflow and other platforms for the answer, but no solution seems to solve this problem.
P.S: My node version is 12.18.3 and npm version is 6.14.6.
If someone can help me resolve this, I would really appreciate it!
I had problem with create-react-app. Solve it using yarn.
yarn global remove create-react-app
then
yarn global add create-react-app
and
create-react-app MyApp

how to fix NPM install packages, that give an error back

Here's the screenshot of the error
After installing (npm init) I try:
$ npm install express
Same thing happens if I try to install any other package.
npm ERR! code UNKNOWN
npm ERR! syscall open
npm ERR! path C:\Users\user\AppData\Roaming\npm-cache\_cacache\index-v5\c3\ae\1314e79200fca71af4663702ee1e676113e408ca8a468a396de5ab6d5d2b
npm ERR! errno -4094
npm ERR! UNKNOWN: unknown error, open 'C:\Users\user\AppData\Roaming\npm-cache\_cacache\index-v5\c3\ae\1314e79200fca71af4663702ee1e676113e408ca8a468a396de5ab6d5d2b'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-05-17T17_14_26_890Z-debug.log
What might this error be?
Remove following directory and try again npm update. It works for me.
C:\Users\user\AppData\Roaming\npm-cache
Some issues can be solved by clearing the cache with npm cache clean.
Run this command and try again. If it still doesn't work, use the -verbose argument to get more output on the installation to see more details.

npm ERR! Refusing to delete when Install react-native

I Have a Problem about NPM, I want to instal npm react-native with command npm install -g react-native-cli on cmd,
But, an error suddenly appeared like this :
npm ERR! path C:\Users\Xeon\AppData\Roaming\npm\react-native.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete C:\Users\Xeon\AppData\Roaming\npm\react-native.cmd: is outside C:\Users\Xeon\AppData\Roaming\npm\node_modules\react-native-cli and not a link
npm ERR! File exists: C:\Users\Xeon\AppData\Roaming\npm\react-native.cmd
npm ERR! Move it away, and try again.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Xeon\AppData\Roaming\npm-cache\_logs\2020-02-12T03_00_40_156Z-debug.log
I don't know why this error appears, hopefully I can find a solution here.
thank you
Check your npm/node version, make sure they install correctly
currently there's no need to install react-native-cli for RN 0.61
you should try
npx react-native init ProjectName
or just using expo instead
npm install -g expo-cli
expo init AwesomeProject
Lastly, you should read the Official Doc for more details.

Cannot run "npm run watch", error message brings up "gulp" error

I am using a web starter kit from coding phase GitHub that normally works fine for me. for some reason when i attempt to run npm run watch it gives me error messages. I'm not 100% positive but I believe this begun when I updated my I did an uninstall and re-install of nodeJS. help me out!
sh: gulp: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! starter-kit-2019#1.1.0 watch: `gulp`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the starter-kit-2019#1.1.0 watch script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/joseperez/.npm/_logs/2018-12-20T02_45_19_840Z-
debug.log
Its because we are using 'gulp' as a global module. So when you removed node from your system, it removed the gulp which is a package installed.
You can reinstall it by using
`npm install gulp-cli -g`
And it will work!
Update:
He is using a mac so try running this command.
$ npm uninstall --global gulp gulp-cli
$ rm /usr/local/share/man/man1/gulp.1
$ npm install --global gulp-cli`
Hope this info turns out useful to someone after doing research on an error that was coming up on my console stating, "gulp: command not found" I found a link that addresses how to fix this. turns out my gulp was not installing properly because there was an issue with my path. btw I am using a Mac machine below is the link that helped me out!
here is the link that helped me out!

Resources