0
点赞
收藏
分享

微信扫一扫

npm相关指令

不会弹吉他的二郎腿 2024-07-24 阅读 7
node.jsnpm


切换镜像


腾讯镜像

npm config set registry https://mirrors.cloud.tencent.com/npm/

淘宝镜像(新版) 

npm config set registry https://registry.npmmirror.com

淘宝镜像(旧版,已弃用)

npm config set registry https://registry.npm.taobao.org/

官方镜像

npm config set registry https://registry.npmjs.org/

清除npm缓存 

npm cache clean --force

检查镜像环境 

npm config get registry

全局安装cnpm并配置淘宝镜像

npm install -g cnpm --registry=https://registry.npmmirror.com


验证cnpm

cnpm --version


全局安装yarn

npm install -g yarn


验证yarn

yarn --version

快速删除node_modules依赖(比手动删除快)

Windows指令

Remove-Item -Recurse -Force node_modules

Unix/Linux指令 

rm -rf node_modules

nvm下载地址(用于切换node版本)

若gitHub打不开,可下载Watt Toolkit(原steam++)加速(免费)

Releases · coreybutler/nvm-windows (github.com)

国内地址

nvm文档手册 - nvm是一个nodejs版本管理工具 - nvm中文网 (uihtm.com)


​Watt Toolkit下载链接

瓦特工具箱(Steam++官网) - Watt Toolkit (steampp.net)

举报

相关推荐

npm指令

npm发包常用指令

npm 入门,基本指令

npm 模块发布指令

NPM相关命令

npm/cnpm相关命令

Redis操作key相关指令

0 条评论