Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not run "next start" #1014

Closed
khrome83 opened this issue Feb 6, 2017 · 9 comments
Closed

Can not run "next start" #1014

khrome83 opened this issue Feb 6, 2017 · 9 comments

Comments

@khrome83
Copy link
Contributor

khrome83 commented Feb 6, 2017

Even though I run "next build", I am not able to run "next start".

I can confirm that a .next folder is created, but I get the following error -

"Could not find a valid build in the '.next' directory! Try building your app with 'next build' before starting the server."

@khrome83
Copy link
Contributor Author

khrome83 commented Feb 6, 2017

Uses "next": "^2.0.0-beta.22"

@timneutkens
Copy link
Member

Can you check if your .next folder has a BUILD_IDfile?

@timneutkens
Copy link
Member

Also, can you provide a sample repository?

@khrome83
Copy link
Contributor Author

khrome83 commented Feb 6, 2017

Where is the BUILD_ID at?

screen shot 2017-02-06 at 8 33 37 am

I won't be able to standup a sample repo currently. Here is a screenshot of the output.

@timneutkens
Copy link
Member

@khrome83 It's located right inside .next (.next/BUILD_ID). From the looks of it this .next folder is from a next dev build. Which is strange because next build should remove the .next folder and then create a new one with the production build. Can you try manually removing .next and running next build again?

@khrome83
Copy link
Contributor Author

khrome83 commented Feb 6, 2017

Apparently it is not building a .next folder. I deleted the .next folder and confirmed that it was because of dev.

When I run npm build which in turn runs next build it just ends. It does not give me any output.

When I run ./node_modules/.bin/next build then it does produce a production .next folder with a BUILD_ID inside.

This is not a issue only locally on my machine. I can confirm, that on node 6.9.1 this is also happening on the GitLab-CI environment.

@nkzawa
Copy link
Contributor

nkzawa commented Feb 6, 2017

@khrome83 try npm run build instead of npm build.

@khrome83
Copy link
Contributor Author

khrome83 commented Feb 6, 2017

Ok that works locally. It's strange because npm build does not trigger unknown NPM command, and does not trigger unknown script error

@nkzawa
Copy link
Contributor

nkzawa commented Feb 6, 2017

Because it's a known command 😂 😂 😂

https://docs.npmjs.com/cli/build

This is really confusing. Anyway closing now.

@nkzawa nkzawa closed this as completed Feb 6, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants