skip to Main Content

So when I try to run npm start this is the error

[Error: ENOENT: no such file or directory, open 'C:UsersElijahvscodeReact projectreact-project.nextBUILD_ID'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\Users\Elijah\vscode\React project\react-project\.next\BUILD_ID'
}

Pretty sure I got my path correct which is
C:UsersElijahvscodeReact projectreact-project>

and my package.json is

{
  "name": "react-project",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "eslint": "8.48.0",
    "eslint-config-next": "13.4.19",
    "next": "13.4.19",
    "react": "18.2.0",
    "react-dom": "18.2.0"
  }
}

I’ve done a clean installation checked if they were downloaded correctly and I’ve also tried deleting package-lock.json and node_modules and running npm install and still nothing. Also tried installing webpack

2

Answers


  1. This happened to me too, it is because one of the folder contains space in its name. In your case it is React project rename it to React-Project and try again

    Login or Signup to reply.
  2. I have also faced the issue.
    Try this first:

    npm run dev
    

    If the above command didn’t helped then try:

    npm run build
    

    It should create a .next directory. Then you can run npm start later on. I don’t know why this issue exists.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search