9

I can't seem to run npm run dev or npm start on my macOS machine. I get a bus error message every time I try to do so, and the output is usually something like this:

klvn git:(main) ✗ npm run dev

> [email protected] dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
[1]    1736 bus error  npm run dev
➜  klvn git:(main) ✗ 

I've tried removing the /node_modules, package-lock.json and /.next folders but that doesn't seem to help. I'm running macOS Monterey.

4 Answers 4

28

The issues actually with node_modules and the package-lock.json file. Delete the following first:

  • delete node_modules directory
  • delete the package-lock.json file

And then run:

npm install
npm run dev

or any other npm command.

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

2 Comments

This actually solved my issue. Wondering why this would happen and why such a confusing error "bus error"
FYI: if anyone is also facing similar issue, I deleted node_modules & package-lock.json 2-3 times, still was facing the issue on Mac M4 Pro Chip(macOS 15 Sequoia), only after restarting the PC the problem was resolved. Not sure deleteting then restarting or just restarting the laptop fixed the problem. Thanks
8

I had this same error with a project I cloned from a repo.

My solution was to delete the local version of it and then clone it again. Then run an npm install and then the npm run dev script again.

1 Comment

This is exactly what I figured out in the end, and it worked. Thank you
0

The issue on my end was due to an unstable internet connection during npm install. As a result, some packages might not have installed correctly. To fix it, I deleted the node_modules folder and ran npm install again once the connection was stable. After that, npm run dev worked fine.

Comments

-2

In my case I got zsh: bus error IDK why but after I searched about bus error it says caused by Error Accessing, it means your Programs like "npm", "node", "nodemon", etc. can't get Access or even Accessed by Linux soo to fix it you only need to add sudo in your command

sudo npm install

Yeah and it works for me

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.