简体   繁体   中英

Why does the npm-remote-ls command return more results than Yarn install command for the babel-loader package?

I'm trying to download npm dependencies for offline use.

when I run npm-remote-ls I get hundreds of dependencies:

> npm-remote-ls --name babel-loader --flatten
[ 'babel-loader@7.1.4',
....
....
... 770 more items ]

When I use Yarn to get the files, I have 18 *.tgz packages

> yarn config set yarn-offline-mirror ~/repository
> yarn install
> ls -l ~/repository
total 124
babel-loader-7.1.4.tgz
find-cache-dir-1.0.0.tgz
mkdirp-0.5.1.tgz
loader-utils-1.1.0.tgz
commondir-1.0.1.tgz
minimist-0.0.8.tgz
pkg-dir-2.0.0.tgz
big.js-3.2.0.tgz
make-dir-1.3.0.tgz
find-up-2.1.0.tgz
emojis-list-2.1.0.tgz
pify-3.0.0.tgz
locate-path-2.0.0.tgz
p-locate-2.0.0.tgz
path-exists-3.0.0.tgz
p-limit-1.3.0.tgz
p-try-1.0.0.tgz
json5-0.5.1.tgz

Any idea why Yarn caches such a small number of packages?

I'm using Yarn 1.7.0, npm 3.10.10, and Node v6.14.3

Thanks, Eyal

The npm install command will install dependencies from the package.json file and allows you to add new packages. yarn install only installs the dependencies listed in yarn.lock or package.json , in that order.

for more to know about see this Yarn vs npm: CLI Differences

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM