首页 > 解决方案 > npm start 处理 react 和 next .js 的问题

问题描述

我刚刚从 GitHub 存储库中克隆了代码。我尝试使用以下命令运行它

 'next' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nextjs@0.1.0 start: `next start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nextjs@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\DELL\AppData\Roaming\npm-cache\_logs\2021-10-12T12_27_53_876Z-debug.log
PS F:\REACT\projectnamme> node -v
v12.16.1
PS F:\REACT\projectnamme> npm -v
6.13.4
F:\REACT\projectnamme> create-react-app --version
3.4.1

标签: reactjsnext.js

解决方案


首先,你需要下载你的 node_modules

你可以使用npm install yarn install

然后在您的终端中执行npm startyarn start


推荐阅读