I have a project using <package-name>
package. After installing this package, is it cached automatically? And how can I check if it is cached? (When I navigate to the npm-cache folder, I see no directory named <package-name>
)
My second question is, when using the command: npm cache add <package-name>
, and then navigating to the npm-cache directory, again I see nothing about <package-name>
there. Why this happens?
npm cache add <package-name> not adding the package to the cache directory
888 Views Asked by moeinghasemi At
2
There are 2 best solutions below
0

According to https://docs.npmjs.com/cli-commands/cache.html
There is currently no method exposed through npm to inspect or directly manage the contents of this cache. In order to access it, cacache must be used directly.
So you'd need to use something like https://www.npmjs.com/package/cacache to inspect the contents directly.
Run
npm config
command. You might have changed thedefault
paths.Command:
$ npm run list
OR
$ npm run ls -l
# for allLook for prefix setting:
prefix
setting// Outputs:
Note: You can also check these in
~/.npmrc
[mac/linux]