Just getting compiler errors when starting a new project
See original GitHub issueBug report
Describe the bug
I am new to next.js (because I searched for a lightweight non-agnostic alternative to meteor for a small side-project). However, I try to create a new Project (the final project will have 2 Pages and 2 express API Endpoints) but I always get a compiler error when trying to start next.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a new Next Project (either doing the tutorial or by
create-next-app) - Start the dev server with
npm run dev - See Compiler Errors (looks like issues with ES6)
Expected behavior
The Tutorial explains how to get a minimal running project.
Screenshots
[keller@bkt testapp] npm run dev
> testapp@1.0.0 dev /home/myuser/repos/testapp
> next
/home/myuser/repos/testapp/node_modules/next/dist/bin/next:31
build: async () => await Promise.resolve().then(() => __importStar(require('../cli/next-build'))).then((i) => i.nextBuild),
^
SyntaxError: Unexpected token (
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testapp@1.0.0 dev: `next`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testapp@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/myuser/.npm/_logs/2019-05-15T13_38_44_069Z-debug.log
System information
- OS: Linux (4.18.16-arch1-1-ARCH)
- Browser didn’t come that far
- Version of Next.js: 8.0.4, 8.1.0
- Node Version: 6.11.2
Additional context
I will try doing a node update first. If it has to do with the node version, it is a documentation bug. If not, it is some other weired bug.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
compilation error while creating new project. 2021.1.20f1
I downloaded Unity 2021.1.20f1 and tried to create a new project, but then a error pops up saying "The project you are opening...
Read more >Why do I get compile errors in every project, even new ones ...
this may be a little different for your project but solution to this is really simple, Open up package manager from Windows->Package manager ......
Read more >Compile error in new project - Unity Forum
I started a new project in 2020LTS and get 2 errors when the project is first built, before I add any assets or...
Read more >Just getting compiler errors when starting a new project #7342
Start the dev server with npm run dev; See Compiler Errors (looks like issues with ES6). Expected behavior. The Tutorial explains how to...
Read more >The Project you are opening contains compilation errors fix
0:00 · New ! Watch ads now so you can enjoy fewer interruptions. Got it ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

In my opinion, this should be stated in the first page of the tutorial, that you check your node version. Many os do have node in their package management and these versions could be outdated.
Frameworks that advertise, that they are easy to use should not crash when starting without any helpful message.
Tim Neutkens notifications@github.com schrieb am Do., 16. Mai 2019, 11:34:
@janpot
Actually because of using an older version of node, probably an older version of npm was also used which might not have these checks 😭