五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網 會員登陸 & 注冊

npm+yarn用法(詳細篇)

2022-01-28 15:42 作者:beyondware  | 我要投稿

## node


### 安裝 node


安裝(推薦:LTS)


> https://nodejs.org/en/


查詢版本


> node -v


> npm -v


### nvm


> https://github.com/coreybutler/nvm-windows


列出可安裝 node 版本


> nvm list available


安裝指定的版本(例如:16.13.0)


> nvm install 版本號


列出已安裝的版本


> nvm list


使用指定的版本(例如:16.13.0)


> nvm use 版本號


## npm


> ~/.npmrc


### 修改 npm 環(huán)境變量


D:\Program Files\nodejs


> 創(chuàng)建 2 個文件夾 node_global 和 node_cache


執(zhí)行命令


> npm config set prefix "D:\Program Files\nodejs\node_global"


> npm config set cache "D:\Program Files\nodejs\node_cache"


在 node_global 下創(chuàng)建 node_modules 文件夾


系統變量-新建


> 變量名:NODE_PATH


> 變量值:D:\Program Files\nodejs\node_global\node_modules


用戶變量


> C:\Users\beyondware\AppData\Roaming\npm


改成


> D:\Program Files\nodejs\node_global


### 安裝 cnpm


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


查詢版本


> cnpm -v


### 修改 npm 源


查看當前 npm 源


> npm config get registry


修改 npm 源


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


還原 npm 源


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


臨時修改


> npm install 包名 --registry=https://registry.npmmirror.com


查看配置列表


> npm config list


### nrm


npm


> https://github.com/Pana/nrm


安裝 nrm


> npm install -g nrm


列出 nrm 源


> nrm ls


使用 taobao


> nrm use taobao


測試響應速度


> nrm test taobao


添加鏡像地址


> nrm add URL 'registry_name'


刪除鏡像地址


> nrm del 'registry_name'


### npm 常用命令


初始化


> npm init

> npm init -y //全部 yes


安裝


> npm install

> npm i

> npm install -dev //開發(fā)環(huán)境

> npm install -g //全局安裝


安裝指定版本


> npm install 包名@版本號

> npm install 包名@latest


刪除


> npm uninstall


升級


> npm update


清空緩存


> npm cache clean --force


## yarn


> ~/.yarnrc


### 修改 yarn 源


查看當前 yarn 源


> yarn config get registry


修改 yarn 源


> yarn config set registry https://registry.npmmirror.com/


還原 yarn 源


> yarn config set registry https://registry.yarnpkg.com/


臨時修改


> yarn save 包名 --registry https://registry.npmmirror.com/


### 修改 yarn 環(huán)境變量


查看 yarn 版本


> yarn -v


創(chuàng)建 yarn_global 文件夾(全局安裝)


> yarn config set global-folder "D:\Program Files\Yarn\yarn_global"


創(chuàng)建 yarn_cache 文件夾(全局緩存)


> yarn config set cache-folder "D:\Program Files\Yarn\yarn_cache"


> yarn config set prefix "D:\Program Files\Yarn\yarn_global"


查看所有配置


> yarn config list


查看當前 bin 位置


> yarn global bin


添加到系統環(huán)境變量


> D:\Program Files\Yarn\yarn_global\bin


查看當前全局安裝位置


> yarn global dir


### yrm


> https://github.com/i5ting/yrm


安裝 yrm


> npm install -g yrm


列出 yrm 源


> yrm ls


使用 taobao


> yrm use taobao


測試訪問速度


> yrm test taobao


### cgr


cgr:npm、yarn


> https://github.com/daysai/cgr


> https://www.npmjs.com/package/cgr


### yarn 常用命令


初始化


> yarn init


安裝所有包


> yarn install


添加依賴項


> yarn add

> yarn add --dev //開發(fā)環(huán)境

> yarn global add //全局安裝


刪除


> yarn remove


升級


> yarn upgrade

> yarn up


列出已安裝


> yarn list


緩存列表


> yarn cache list


清空緩存


> yarn cache clean


npm+yarn用法(詳細篇)的評論 (共 條)

分享到微博請遵守國家法律
新竹县| 保亭| 芦山县| 当涂县| 定远县| 丰都县| 班玛县| 措勤县| 杭州市| 东乌珠穆沁旗| 德兴市| 台中市| 武定县| 龙山县| 根河市| 于田县| 旺苍县| 江西省| 高平市| 吉木乃县| 三台县| 池州市| 乌拉特后旗| 准格尔旗| 平原县| 高州市| 望城县| 重庆市| 旌德县| 锡林郭勒盟| 米脂县| 武功县| 仪征市| 民勤县| 郎溪县| 囊谦县| 郯城县| 武山县| 石台县| 苏州市| 舟曲县|