yarn相关命令:
查看bin目录命令:yarn global bin
查看global目录命令:yarn global dir
查看cache目录命令:yarn cache dir
yarn config set prefix "自定义bin目录路径"
yarn config set global-folder "自定义node_modules目录路径"
yarn config set cache-folder "自定义cache目录路径"
查看当前源: yarn config get registry
更换源: yarn config set registry https://registry.npm.taobao.org
yarn相关命令:
查看bin目录命令:yarn global bin
查看global目录命令:yarn global dir
查看cache目录命令:yarn cache dir
yarn config set prefix "自定义bin目录路径"
yarn config set global-folder "自定义node_modules目录路径"
yarn config set cache-folder "自定义cache目录路径"
查看当前源: yarn config get registry
更换源: yarn config set registry https://registry.npm.taobao.org
安装cnpm:npm install -g cnpm -registry=https://registry.npm.taobao.org
设置全局路径:npm config set prefix D:/Node/nodejs/node_global/
设置缓存路径:npm config set cache D:/Node/nodejs/node_cache/
查看npm路径:npm bin -g
查看node_modules文件路径:npm root -g
安装全局软件包:npm install -g xxx
查看全局软件包:npm list -g --depth 0
安装本地软件包:npm install xxx
npm config get prefix
npm config set prefix "D:\npm\node_global"
npm config get cache
npm config set cache "D:\npm\node_cache"
国内使用 npm 速度很慢,可以使用淘宝定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm。
pnpm相关命令: