[英]After running npm start in react application I have this error: internal/modules/cjs/loader.js:834
I downloaded my course react project, get into it, install dependencies and tried to run npm start.我下载了我的课程反应项目,进入它,安装依赖项并尝试运行 npm start。 I got this nasty error:
我得到了这个讨厌的错误:
PS C:\Users\Marcin & Joanna\Desktop\react-frontend-01-starting-setup> npm start
> frontend@0.1.0 start C:\Users\Marcin & Joanna\Desktop\react-frontend-01-starting-setup
> react-scripts start
'Joanna\Desktop\react-frontend-01-starting-setup\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module 'C:\Users\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60: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! frontend@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@0.1.0 start 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\Marcin & Joanna\AppData\Roaming\npm-cache\_logs\2020-10-23T07_19_44_441Z-debug.log
PS C:\Users\Marcin & Joanna\Desktop\react-frontend-01-starting-setup>
I tried with others project, same results.我尝试了其他项目,结果相同。 I tried to run npx-create-react-app my-app with no success, I got this error:
我试图运行 npx-create-react-app my-app 但没有成功,我收到了这个错误:
PS C:\Users\Marcin & Joanna\Desktop\mernStack> npx create-react-app frontend
Error: EPERM: operation not permitted, mkdir 'C:\Users\Marcin'
System nie może odnaleźć określonej ścieżki.
Instalacja [ 'create-react-app@latest' ] nie udała się, kod błędu: 1
PS C:\Users\Marcin & Joanna\Desktop\mernStack>
Those lines in Polish simply say:波兰语中的那些行简单地说:
System can not find specified path.系统找不到指定的路径。
Installation [ 'create-react-app@latest' ]failed, error code 1.安装 ['create-react-app@latest'] 失败,错误代码 1。
I recently upgraded Node to version 14 and since then I got this issue.我最近将 Node 升级到了 14 版,从那时起我就遇到了这个问题。 It doesn't matter which node version I install, I still got the same errors.
无论我安装哪个节点版本都没有关系,我仍然遇到相同的错误。
Remove &
from the project path in: \\ Marcin & Joanna
从项目路径中删除
&
: \\ Marcin & Joanna
It is better to change the saved path of the project最好更改项目的保存路径
did you try in the project directory:您是否在项目目录中尝试过:
npm install
or或者
npx autofix
or try to create your app in a different directory.或者尝试在不同的目录中创建您的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.