如何在npm5的install命令中指定缓存文件夹? [英] How to specify cache folder in npm5 on install command?

查看:381
本文介绍了如何在npm5的install命令中指定缓存文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在纱线中,可以使用 yarn --cache-folder [CACHE_FOLDER] ,npm5替代品是什么?

In yarn it's possible using yarn --cache-folder [CACHE_FOLDER], what is npm5 alternative?

可以使用单独的命令 npm config set cache [CACHE_FOLDER] 进行设置,但我很好奇是否可以通过将某些参数传递给 npm install

It's possible to set it with separate command npm config set cache [CACHE_FOLDER], but I'm curious if it's possible to do with just passing some argument to npm install

我已经检查过 v5.0.1发行说明 npm install 文档,但找不到有关设置缓存文件夹的任何信息

I've checked v5.0.1 release notes and npm install docs but can't find anything about setting cache folder

推荐答案

@maybekatz(npm工程师)在Twitter上回答,可以使用-cache 参数:

As answered by @maybekatz (npm engineer) on twitter it's possible using --cache argument:

npm install --cache [CACHE_FOLDER]

这篇关于如何在npm5的install命令中指定缓存文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆