Support npm_config_cache environment variable
Author: xzyferCreated Nov 3, 2016Updated Jun 23, 2026
Labelscat-compatibility
Do you want to request a feature or report a bug?
bug
What is the current behavior?
yarn run v0.16.1
$ node -p process.env.npm_config_cache
undefined
✨ Done in 0.28s.If the current behavior is a bug, please provide the steps to reproduce.
Print process.env.npm_config_cache in an npm script
"scripts": {
"foo": "node -p process.env.npm_config_cache"
}yarn run fooWhat is the expected behavior?
> node -p process.env.npm_config_cache
/Users/michael/.npmPlease mention your node.js, yarn and operating system version.
$ node -p process.versions
{ http_parser: '2.7.0',
node: '6.5.0',
v8: '5.1.281.81',
uv: '1.9.1',
zlib: '1.2.8',
ares: '1.10.1-DEV',
icu: '57.1',
modules: '48',
openssl: '1.0.2h' }
$ node -v
v6.5.0
$ npm -v
3.10.3
$ yarn --version
0.16.1OS X El Capitan
Source: yarnpkg/yarn