vue.js安装问题

时间:2022-07-17 19:00:50
1.安装:npm install --global vue-cli
2.创建项目:vue init webpack my-project
npm WARN deprecated browserslist@2.11.: Browserslist  could fail on reading Browserslist >3.0 config used in other tools.
npm ERR! Unexpected end of JSON input while parsing near '...":"3.9.1","gulp-babel' npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\--29T13_18_16_946Z-debug.log

3.解决办法:npm cache clean --force

4.npm install

还有一种常见的错误:报Vue不是内部命令:

解决方案:配置npm环境变量:注意只有电脑重启,才能生效vue.js安装问题