Skip to content
This repository has been archived by the owner on Feb 6, 2019. It is now read-only.

Nuxt-Community Starter Template Fails to Build #70

Closed
brandonaaskov opened this issue May 28, 2018 · 20 comments
Closed

Nuxt-Community Starter Template Fails to Build #70

brandonaaskov opened this issue May 28, 2018 · 20 comments

Comments

@brandonaaskov
Copy link

Version

1

Reproduction link

https://cl.ly/rr5G

Steps to reproduce

Using node 8.11.2, literally just follow the instructions in the installation guide (https://nuxtjs.org/guide/installation):

  1. vue init nuxt-community/starter-template
  2. cd
  3. npm install
  4. npm run dev

Bam. Errors. Won't load in browser.

What is expected ?

It should build without errors and serve me the default start page at http://localhost:3000

What is actually happening?

I get several build errors stating "Module build failed: Error: No parser and no file path given, couldn't infer a parser" and the site won't load.

Additional comments?

This starter template is surprisingly old considering how much activity has happened with both Nuxt and Vue over that same span of time, particularly with vue-clie@3. I might be speaking out of line, but does this thing need to be updated?

This bug report is available on Nuxt.js community (#c51)
@ghost ghost added the cmty:bug-report label May 28, 2018
@warriorBrian
Copy link
Member

@dohomi hello ,I also have the same problem,
I am in China,Today suddenly initialized template error

@aldarund
Copy link
Member

vuejs/component-compiler-utils#15
i guess its already fixed
https://www.npmjs.com/package/@vue/component-compiler-utils
1.3.1 43 minutes ago

@brandonaaskov
Copy link
Author

Thanks @aldarund! I didn’t see that. Happy to see that this has traction on a holiday weekend. Some use the time to BBQ and celebrate with family (I am fortunate to be in this camp), and others either “working” by choice, or the less fortunate being forced to work through this minutiae. Whatever the case is for @pwang2, thank you!

@warriorBrian
Copy link
Member

@albanm I still have a mistake
未命名1527486378.png

@aldarund
Copy link
Member

@warriorBrian reinstall packages

@warriorBrian
Copy link
Member

@aldarund I tried to remove node_modules, but it still does not work, so I changed module:npm install prettier@~1.12.1 to version 1.12.1. I don't know whether this should be the case all the time.

@aldarund
Copy link
Member

@warriorBrian using @vue/component-compiler-utils 1.3.1 instead of previous version will work too

@warriorBrian
Copy link
Member

@aldarund Thank you, although I can't successfully apply @vue/component-compiler-utils to solve this problem, but I hope the official can give the latest solution. Thank you.

@sadrbox
Copy link

sadrbox commented May 28, 2018

Hi.
I reinstall all of packages everywhere and I still have error, but if I install prettier 1.12 it works. This need to fix.

@n1kk
Copy link

n1kk commented May 28, 2018

Same issue here, reinstalling packages didn't help.
Seems like this commit was the fix vuejs/component-compiler-utils@598224d, but even though vue-loader package was updated 8 hours ago the issue still persists.

Tried cleaning npm cache with npm cache clean --force, didn't help.
Maybe it's npm's server internal cache.

If you search node_modules for line from the commit with the fix

      code = prettier.format(code, { semi: false })

you'll find it in file node_modules/vue-loader/lib/template-compiler/index.js line 80
replacing it with this

      code = prettier.format(code, { semi: false, parser: 'babylon' })

will fix all errors.

@aldarund
Copy link
Member

@pwang2
Copy link

pwang2 commented May 28, 2018

😀. @brandonaaskov I was surprised to be mentioned here. For my case, I was enjoying some peaceful time since I have backup to take care of my 👶🏻boy over the weekend and it was an 100F hot humid afternoon.

The issue has affected a few tools, projects in the eco system. AFAIK, there are

  • projects using vue-cli
  • projects using nuxt
  • project using vue-loader (v14 and v15)

You might want to see my latest update here.

vue-loader v14/v13 has also been hotfixed as @aldarund pointed out above.

@NicoPennec
Copy link
Member

hi @brandonaaskov, the submodules have been fixed :)

Can you recheck your issue and close if solved ?

@brandonaaskov
Copy link
Author

@NicoPennec, confirmed! Thanks again all!

@johnyluyte
Copy link

johnyluyte commented Jun 5, 2018

Hi, I've just done a fresh install like the OP did. There's no error now, but there are a lot of warning messages repeating the following text:

No parser and no filepath given, using 'babylon' the parser now but this will throw an error in the future. Please specify a parser or a filepath so one can be inferred.

The same messages repeat a lot of times and almost filled up all my screen. However, the compile was successful without error.

Is anyone seeing the same warning message? Is it harmful or can we safely ignore them?

npm list --depth=0
+-- babel-eslint@8.2.3
+-- eslint@4.19.1
+-- eslint-friendly-formatter@3.0.0
+-- eslint-loader@1.9.0
+-- eslint-plugin-vue@4.5.0
`-- nuxt@1.4.0

@ausir0726
Copy link

@johnyluyte follow this , add vue-loader until nuxt upgrade

nuxt/nuxt#3400

@johnyluyte
Copy link

@ausir0726 Thanks. Thought it was the template problem so I didn't checkout the nuxt issue. Very excited about the 2.0 release.

@tetreault
Copy link

I have this issue as well. Have used nuxt previously without any issue. I've used nuxt in prior projects, but am working on a fresh one and just got faced with this error when running npm run start for the first time:

Stephens-MacBook-Pro-2:CLIENT_DIR stephentetreault$ npm run start 

> nuxt-monkey-famous@1.0.0 start /Users/stephentetreault/git/ORG/CLIENT/CLIENT_DIR/CLIENT_PROJECT
> nuxt start

/Users/stephentetreault/git/ORG/CLIENT/CLIENT_DIR/CLIENT_PROJECT/node_modules/nuxt/lib/core/middleware/nuxt.js:72
      const policies = this.options.render.csp.policies ? {...this.options.render.csp.policies} : null
                                                           ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/stephentetreault/git/ORG/CLIENT/CLIENT_DIR/CLIENT_PROJECT/node_modules/nuxt/lib/core/renderer.js:19:24)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! CLIENT_PROJECT@1.0.0 start: `nuxt start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the CLIENT_PROJECT@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Misc:
Node: v8.2.1
NPM: v6.1.0

@NicoPennec
Copy link
Member

NicoPennec commented Jun 7, 2018

@tetreault node >=8.6 is required for Nuxt (see #61)

your current version doesn't support spread operator.

please, try to upgrade your node.js install to the latest node 8 LTS version => https://nodejs.org/en/

@tetreault
Copy link

tetreault commented Jun 7, 2018

Yes i see why now @NicoPennec and I've remedied my issue.

In a prior comment on another issue thread for nuxt i also asked this question: is it wise for nuxt to require a higher version of node than the current Node LTS? The nodejs site recommends v8.11.2 for current LTS, so why not peg your compatibility to the current LTS of node, rather than one just slightly higher than the LTS. You'd sure have more reach this way. Just some food for thought.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants