1

I'm trying to install express via nodeJS and the errors that I am getting tell me that I should rename my directories. I have already run npm init in my project folder so I assume the setup is correct. The exact command that I use is: npm install express --save and the npm-debug.log lists a bunch of statements prefaced with "silly" but the most significant ones (imo) are below:

3242 verbose stack Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3242 verbose stack     at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
3242 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
3242 verbose stack     at FSReqWrap.oncomplete (fs.js:123:15)
3242 verbose stack
3242 verbose stack Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3242 verbose stack     at Error (native)
3243 verbose cwd C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron
3244 error Windows_NT 10.0.16299
3245 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express" "--save"
3246 error node v6.11.2
3247 error npm  v3.10.10
3248 error path C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf
3249 error code EPERM
3250 error errno -4048
3251 error syscall rename
3252 error Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3252 error     at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
3252 error     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
3252 error     at FSReqWrap.oncomplete (fs.js:123:15)
3252 error
3252 error Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3252 error     at Error (native)
3252 error  { Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3252 error     at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:25:7)
3252 error     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
3252 error     at FSReqWrap.oncomplete (fs.js:123:15)
3252 error
3252 error Error: EPERM: operation not permitted, rename 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\.staging\depd-c51a5acf' -> 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd'
3252 error     at Error (native) parent: 'microtrack' }
3253 error Please try running this command again as root/Administrator.
3254 verbose exit [ -4048, true ]`

CONTEXT: I've been following along with Brad Traversy's NodeJS and Express database app series on YT in an attempt to learn some backend stuff to use in my side project and the command he used (listed above) works flawlessly.

Thanks in advance for any help/suggestions.

KARTHIKEYAN.A
  • 11,752
  • 4
  • 81
  • 93

2 Answers2

1

I was doing some more research and I found that running the npm install commands after closing the atom IDE worked. Thanks for all the help guys!

full thread: https://github.com/npm/npm/issues/12059 answer towards bottom of page

0

Check if your problem is caused by the directory called .staging. Usually when a directory starts with . means is a hided folder so in this case the installer is avoiding that folder and as a consequence it's trying to find the path 'C:\Users\Leungi5368\Documents\CS Education\Side Projects\TimeManagerElectron\TimeManagerElectron\node_modules\depd' which doesn't exists

axl-code
  • 1,718
  • 1
  • 12
  • 21