npm i fails after updating node

I’m now getting this when trying to run npm i:

    npm i
    npm ERR! path /home/ole/.npm/_cacache/index-v5/37/b4
    npm ERR! code EACCES
    npm ERR! errno -13
    npm ERR! syscall mkdir
    npm ERR! Error: EACCES: permission denied, mkdir '/home/ole/.npm/_cacache/index-v5/37/b4'
    npm ERR!  [OperationalError: EACCES: permission denied, mkdir '/home/ole/.npm/_cacache/index-v5/37/b4'] {
    npm ERR!   cause: [Error: EACCES: permission denied, mkdir '/home/ole/.npm/_cacache/index-v5/37/b4'] {
    npm ERR!     errno: -13,
    npm ERR!     code: 'EACCES',
    npm ERR!     syscall: 'mkdir',
    npm ERR!     path: '/home/ole/.npm/_cacache/index-v5/37/b4'
    npm ERR!   },
    npm ERR!   isOperational: true,
    npm ERR!   stack: 'Error: EACCES: permission denied, mkdir ' +
    npm ERR!     "'/home/ole/.npm/_cacache/index-v5/37/b4'",
    npm ERR!   errno: -13,
    npm ERR!   code: 'EACCES',
    npm ERR!   syscall: 'mkdir',
    npm ERR!   path: '/home/ole/.npm/_cacache/index-v5/37/b4',
    npm ERR!   parent: 'config-chain'
    npm ERR! }
    npm ERR! 
    npm ERR! The operation was rejected by your operating system.
    npm ERR! It is likely you do not have the permissions to access this file as the current user
    npm ERR! 
    npm ERR! If you believe this might be a permissions issue, please double-check the
    npm ERR! permissions of the file and its containing directories, or try running
    npm ERR! the command again as root/Administrator (though this is not recommended).

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/ole/.npm/_logs/2019-05-14T21_15_39_992Z-debug.log

I’ve tried changing the ownership and permission of the files and deleting node_modules in the project directory but none of these steps work. Thoughts?

This is the repository it is doing it for. The other repositories under this organization are OK: https://github.com/superflycss/utilities-effects

Did you delete that directory and re-try the npm install?

Have you tried resetting the ownership of the cache directory, not just the project?


sudo chown -R $(whoami) ~/.npm

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.