最近在npm打包時,總遇到打包各種失敗,在次總結下方法:
npm大作戰:
npm升級
npm install -g npm
cnpm應用:
npm的鏡像替換爲淘寶
1、得到原本鏡像地址
npm get registry
2、設置成淘寶鏡像
npm config set registry http://registry.npm.taobao.org/
yarn config set registry http://registry.npm.taobao.org/
3、換成原來的
npm config set registry https://registry.npmjs.org/
同步模塊
cnpm sync transform-vue-jsx
安裝模塊:
cnpm install clean-webpack-plugin
通用解決方法:
1、刪除node_modules
2、重新npm i
3、根據日誌查錯