windows安装webpack
1.创建webpack文件夹
2.从cmd进入文件夹,用 npm init 命令进行初始化
3.输入 npm install webpack -g –save-dev 命令进行安装
安装注意事项:
全局安装: npm install webpack -g
本地安装: npm install webpack –save-dev
报错
npm ERR! Unexpected end of JSON input while parsing near
解决办法
1.删掉package.lock.json
2.清除cache
npm cache clean --force
3.进入下面这个文件夹清除cache
路径:C:/Users/PC/AppData/Roaming/npm-cache
执行:
npm cache clean --force
4.不要用淘宝镜像。
npm set registry registry.npmjs.org/