npm常用命令

  • npm config edit 直接打開編輯

  • npm config list 查看相關(guān)信息

  • npm config get cache 緩存位置

  • npm config get prefix 全局安裝的位置

  • npm config set prefix "<new_path>" 修改全局文件安裝的位置

  • npm config set cache "<new_path>" 修改緩存文件的位置

  • npm config get registry 查看是什么源

  • npm install --registry=https://registry.npm.taobao.org 暫時換淘寶源

  • npm config set registry http://registry.npm.taobao.org 換淘寶源

  • npm config set registry https://registry.npmjs.org/ 換回npm源

  • npm install --save 保存在package.json中dependencies字段下,安裝生產(chǎn)環(huán)境依賴的模塊

  • npm install --save-dev 保存在package.json中devDependencies字段下,安裝開發(fā)環(huán)境依賴的模塊

  • npm install -g npm @latest 更新npm

  • npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass 更換node_sass源

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容