Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
555 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...