繁体   English   中英

NPM 错误,NEXT.JS 错误无法使用 npm run dev

[英]NPM ERROR, NEXT.JS ERROR can not use npm run dev

> @ dev C:\Users\Mustafa\Desktop\React&Next\insta-2.0
> next dev

'Next\insta-2.0\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'C:\Users\Mustafa\Desktop\next\dist\bin\next'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)        
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76: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! @ dev: `next dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ 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\Mustafa\AppData\Roaming\npm-cache\_logs\2021-10-13T15_27_45_466Z-debug.log

我正在使用 npm run dev,它给了我这个错误,我不明白这个错误是关于什么的,如果你们能帮我解决这个问题,我真的很感激

转到next projectroot目录并在terminal运行以下命令:

npm install next react react-dom

npm run dev

或者,如果您使用的是VSCodeVisual Studio Code打开您的next project ,运行集成终端(Ctrl+`)并输入上述命令。

现在应该可以使用了 ;-)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM