Running with NPM_CONFIG_PREFIX is not respected


(Kevin Simper) #1

I don’t understand why nom tries to read from /root/.npm when I specify NPM_CONFIG_PREFIX and that it should be something different.

+ NPM_CONFIG_PREFIX=/tmp/.npm-global npm i
Unhandled rejection Error: EROFS: read-only file system, mkdir '/root/.npm'
Unhandled rejection Error: EROFS: read-only file system, mkdir '/root/.npm'
Unhandled rejection Error: EROFS: read-only file system, mkdir '/root/.npm'
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>


(Kat Marchán) #2

What you’re looking for in this case is --cache /tmp/.npm-global (or npm_config_cache=...).


(Kevin Simper) #3

Hi zkat, thanks for the help, it seems to be the correct solution.

I got the other solution from here, can I help add this solution to that page? https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally


(Kat Marchán) #4

You should make a post in #support:docs-needed and we’ll take care of it!