I ran `next build` but it is saying `next command` not found

See original GitHub issue

Bug report

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of Next.js: [e.g. 6.0.2]

Additional context

Add any other context about the problem here. I ran next build but it is saying next command not found

next build

Command 'next' not found, but can be installed with:

sudo apt install mailutils-mh
sudo apt install mmh
sudo apt install nmh

I followed above instructions but I am getting same problem.

  • I also used npm install next --save but I am getting same error.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

44reactions
eddythemeddycommented, Jan 23, 2021

I fixed this issue by running the below command:

npm i -g next

32reactions
vicky-dev31113commented, Feb 23, 2021

I fixed the by removing node_modules and added again:

  1. rm -rf node_modules
  2. npm install
Read more comments on GitHub >

github_iconTop Results From Across the Web

Next command not found : r/reactjs
it says “command not found”, It first gives me a path to run and then it has “next Dev” but, is that what...
Read more >
next.js - "command not found: create-next-app" how do I ...
Create a new folder and name it as you like,then open your terminal & go into the project folder and run the step...
Read more >
module-not-found
The module you're trying to import is in a different directory. Make sure that the path you're importing refers to the right directory...
Read more >
Why am I not able to start my application? - JavaScript
This is the only error message I get in the terminal (after I enter the command 'npm run dev'):. sh: next: command not...
Read more >
no next.js version could be detected in your project. make ...
Docs says that the build command npm install --prefix=../.. is only required if using npm workspaces, and doesn't apply when using pnpm or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found