nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.45k stars 278 forks source link

Node can not find module. Please Help #4203

Closed ghost closed 2 months ago

ghost commented 1 year ago

Details

Hi. I use next.js/ When I want run project it gives me error. Here is error:

PS C:\Users\User\Desktop\TS & Next\typenext> npm run dev

> typenext@0.1.0 dev
> next dev

"Next\typenext\node_modules\.bin\" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
node:internal/modules/cjs/loader:1078
  throw err;
  ^

Error: Cannot find module 'C:\Users\User\Desktop\next\dist\bin\next'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.16.0

I reinstalled node_modulesa and cleaned npm cache. But it alredy gives error.

Node.js version

Node.js v18.16.0

Example code

No response

Operating system

Windows 10 Pro

Scope

Runtime

Module and version

Not applicable.

prettydiff commented 1 year ago

It looks like next is not installed. You can install it globally with npm install next -g

preveen-stack commented 12 months ago

@XausMaster could you check the above suggestion

dn1provskiy commented 6 months ago

npm install next -g

Thank you, it helped me. +rep

RedYetiDev commented 2 months ago

Author is @ghost, so getting more info from them wouldn't exactly be easy

ghost commented 1 month ago

Thank you! Your information has been immensely helpful to me too!!

It looks like next is not installed. You can install it globally with npm install next -g