1、在"C:\Users\用户"文件夹下创建文件".npmrc"。
2、在文件中写入如下内容:
bash
registry=http://npm.xxxxx.local/
prefix=C:\03storage\nodejs
cache=C:\03storage\npm-cache
说明:
第一行:本地私服
第二行:已经安装的工具包
第三行:npm的缓存,下载的安装包的临时文件的存储位置。
3、测试效果
打开cmd窗口分别执行命令,就可以看到对应的目录,就说明配置生效了
npm config get cache
npm config get registry
npm config get prefix