Har*_*hah 10 vue.js vue-component vuejs2 prettier
Module build failed: Error: No parser and no file path given, couldn't infer a parser.
at normalize (/home/nayan/dd_pwa/node_modules/prettier/index.js:7051:13)
at formatWithCursor (/home/nayan/dd_pwa/node_modules/prettier/index.js:10370:12)
at /home/nayan/dd_pwa/node_modules/prettier/index.js:31115:15
at Object.format (/home/nayan/dd_pwa/node_modules/prettier/index.js:31134:12)
at Object.module.exports (/home/nayan/dd_pwa/node_modules/vue-loader/lib/template-compiler/index.js:80:23)
@ ./layouts/error.vue 7:0-368
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi webpack-hot-middleware/client?name=client&reload=true&timeout=30000&path=/__webpack_hmr ./.nuxt/client.js
Run Code Online (Sandbox Code Playgroud)
我在Nuxtjs上遇到了同样的问题.任何面临同样问题的人 救命?!!版本:"nuxt":"^ 1.0.0","更漂亮":"^ 1.12.1"
尝试了降级和升级更漂亮版本的所有选项.
Wal*_*ale 26
更新:我在下面的评论中提到了这一点,但由于某种原因人们仍然提到同样的事情.
甚至懒得降级.这是一个小问题.我在这里给出了解释以及对我
有用的东西:简而言之:转到:
node_modules\vue-loader\lib\template-compiler...打开index.js并寻找
// prettify render fn
if (!isProduction) {
code = prettier.format(code, { semi: false})
}
并将行更改为:
// prettify render fn
if (!isProduction) {
code = prettier.format(code, { semi: false, parser: 'babylon' })
}
Run Code Online (Sandbox Code Playgroud)
而已!