Running into “couldn't infer parser” error using vue-cli

后端 未结 5 1772
天命终不由人
天命终不由人 2020-12-31 14:59

I\'m getting an error repeatedly when trying to build a new webpack project using vue-cli. I\'m following along with the docs on the latest build (3.0.0-beta.11

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 15:13

    Known issue and it will be fixed in the next version of vue-cli

    In prettier 1.13.0, default parser was removed with a minor version(used to be babylon)

    Issue: https://github.com/vuejs/component-compiler-utils/issues/14

    Issue at prettier repo: https://github.com/prettier/prettier/issues/4567

    Sorry, we committed the age-old semver sin- we knew this was a breaking change, but because it would only affect a subset of our users, we didn't bump the major version, because we didn't want to create friction for our users to upgrade.

    To get the old behavior, add parser: "babylon". You may also want to lock prettier to a specific version in your package.json.

提交回复
热议问题