Aman Ansari
Aman Ansari

Reputation: 1

I was running my nextJs server, all of a sudden an error is coming,

npm run dev

[email protected] dev D:\Aman\aquadsoft\ept-react\new\ept-react next

internal/modules/cjs/loader.js:969 throw err; ^

Error: Cannot find module 'D:\Aman\aquadsoft\ept-react\new\ept-react\node_modules\next\dist\bin\next' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15) at Function.Module._load (internal/modules/cjs/loader.js:842:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] dev: next npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\AMAN\AppData\Roaming\npm-cache_logs\2020-07-11T05_00_56_071Z-debug.log

Upvotes: 0

Views: 1797

Answers (1)

Aman Ansari
Aman Ansari

Reputation: 1

It worked finally, with removing the npm and npm-cache folder and then running command

npm install -g npm@latest

After that installed nextJs globally and run npm install inside my project directory. It worked.

Upvotes: 0

Related Questions