webpack全局安装
在vscode新建一个文件夹,选中这个文件夹右键点击 在集成终端打开
1.先初始化 npm init
2.下包 webpack_text
3.一直按回车键
4.npm i webpack webpack-cli -g
当报下面的错误时:
npm ERR! code ENOTFOUND
.npm.taobao.org
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network ‘proxy’ config is set properly. See: ‘npm help config’
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\24634\AppData\Roaming\npm-cache\_logs\2020-11-29T11_43_08_858Z-debug.log
输入以下指令:
npm config set registry http://registry.cnpmjs.org/
然后在输入第4个指令
5.然后在本地安装
npm i webpack webpack-cli -D