NPM Install Error

I have been working on the content creators and rock paper scissors project. When I try and run npm install, I always get this error. It seems to be some folder that doesn’t seem to work. It always fails to install some node module.

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\kwokj\Dropbox\codecademy\1\node_modules\debug
npm ERR! dest C:\Users\kwokj\Dropbox\codecademy\1\node_modules.debug.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename ‘C:\Users\kwokj\Dropbox\codecademy\1\node_modules\debug’ -> ‘C:\Users\kwokj\Dropbox\codecademy\1\node_modules.debug.DELETE’
npm ERR! enoent This is related to npm not being able to find a file.

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\kwokj\Dropbox\codecademy\1\node_modules\color-name
npm ERR! dest C:\Users\kwokj\Dropbox\codecademy\1\node_modules.color-name.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename ‘C:\Users\kwokj\Dropbox\codecademy\1\node_modules\color-name’ -> ‘C:\Users\kwokj\Dropbox\codecademy\1\node_modules.color-name.DELETE’

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\kwokj\Dropbox\codecademy\1\node_modules\escape-string-regexp
npm ERR! dest C:\Users\kwokj\Dropbox\codecademy\1\node_modules.escape-string-regexp.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename ‘C:\Users\kwokj\Dropbox\codecademy\1\node_modules\escape-string-regexp’ -> ‘C:\Users\kwokj\Dropbox\codecademy\1\node_modules.escape-string-regexp.DELETE’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

After I run npm install 5-10 times, all packages install. But I have no idea why this is happening.

I remember it being moody and a bit tricky, git aswell, it does have to be sort of in the right folder, which I’m reading a bit off that on your error messages, and if you google it :

The error Error : ENOENT , stat 'C:\Users<user>\AppData\Roaming\ npm ’ on Windows 7 is a consequence of joyent/node#8141, and is an issue with the Node installer for Windows. The workaround is to ensure that C:\Users<user>\AppData\Roaming\ npm exists and is writable with your normal user account.

the second error this might help
stackoverflow link

you really should not have to install it like 5-10 times, if you have all your packages and still have issues try npm rebuild …

do i do those commands in the folder of my codeacademy files or globally?

Are you doing this on a web browser or your computer locally?

If it is part of the class (on your web browser), you don’t have to do anything, maybe refresh the page, or you might have to restart the lesson to #1.