vue webpack template missing parser

后端 未结 7 1354
离开以前
离开以前 2020-12-07 17:28

I was just setting up a vue project using the webpack template like stated here: http://vuejs-templates.github.io/webpack/

However after running npm run dev just to

相关标签:
7条回答
  • 2020-12-07 18:10

    I use Nuxt/Vue on Docker. I got same error with docker build.

    It doesn't work after below commands

    rm -rf node_modules 
    npm install --save-dev prettier@1.12.0
    npm run dev
    

    So I edited Dockerfile like this and it worked.

    FROM node:8.11
    
    RUN mkdir -p /app
    COPY . /app
    WORKDIR /app
    
    RUN npm install && npm cache verify
    RUN npm install --save-dev prettier@1.12.0
    RUN npm run build
    
    EXPOSE 3000
    
    CMD ["npm", "run", "express"]
    
    0 讨论(0)
  • 2020-12-07 18:12

    Prettier has caused this regression in their 1.13.0 update which occurred today. Downgrade to the previous version to fix this error:

    npm install --save-dev prettier@1.12.0

    npm run dev

    That should do the trick.

    0 讨论(0)
  • 2020-12-07 18:19

    If you are using laravel-mix then this fixed it for me:

    Remove .\node_modules, remove .\yarn.lock then add following to .\package.json

    "dependencies": {
        ...
        "prettier": "1.12.1",
        "vue-loader": "13.7.0"
        ...
    },
    "resolutions": {
        "laravel-mix/vue-loader": "13.7.0",
        "vue-loader/prettier": "1.12.1"
    }
    

    run yarn and all should be working.

    0 讨论(0)
  • 2020-12-07 18:21

    I got the same error with yarn, but tried npm i and npm run dev instead and it worked.

    yarn v v1.5.1 npm -v 5.6.0 node -v v10.0.0

    0 讨论(0)
  • 2020-12-07 18:23

    it is fixed in vue-loader@13.7.2 and vue-loader@14.2.3. So just upgrade.

    0 讨论(0)
  • 2020-12-07 18:24

    If you're using Yarn add this to your package.json to force @vue/component-compiler-utils to use the right version:

    "resolutions": {
      "@vue/component-compiler-utils/prettier": "1.12.1"
    }
    

    Then do a fresh install.

    reference

    0 讨论(0)
提交回复
热议问题