打开控制台进入想要创建项目的目录

vue init webpack ”项目名称“

? Project name personal
? Project description A Vue.js project
? Author ppzy123
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created
? (recommended) npm

那几个no一定要no,不然写起来会很惨

 

npm报错出现缺少babel
治标的解决方法:
找到你的工程文件夹里的 YourProName\node_modules\vue-loader\lib\template-compiler\index.js
//将以下代码
if (!isProduction) {
code = prettier.format(code, { semi: false, parser: 'babylon' })
}
//修改为:
if (!isProduction) {
code = prettier.format(code, { semi: false, parser: 'babel' })

相关文章:

  • 2021-10-04
  • 2021-10-26
  • 2022-02-05
猜你喜欢
  • 2022-12-23
  • 2022-01-09
  • 2021-04-30
  • 2021-10-18
  • 2021-05-15
  • 2021-10-16
相关资源
相似解决方案