0

I have an app already deploy on vercel , i change just a a content in a page and push it on git without problem(i make that many times without problem before), but now i can't execute npm run build return an error , the same error on vercel deploy. Can any one help me to fix this issue.

00:50:06.011 > next .next/build 00:50:06.209 > No such directory exists as the project root: /vercel/workpath0/portfolio/.next/build

the script in package.json

"scripts": {
"dev": "next dev",
"build": "next .next/build",
"start": "next start"

},

vercel deploy terminal

3
  • 2
    build script should be "build": "next build" Commented Jan 6, 2021 at 12:43
  • yes it work thanks, but i dont understnd why , the other project i have work fine whith the same script. Commented Jan 6, 2021 at 12:54
  • anyway thanks @NileshPatel :) Commented Jan 6, 2021 at 12:55

1 Answer 1

1

The reason its failing with "No such directory exists" is because the .next directory doesn't exist until you run next build, which is the command that generates the output.

Change your build script to next build, like it shows in the Next.js docs, and it will work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.