[英]npm start not working after create-react-app
I am trying to create a react app with the below steps:我正在尝试通过以下步骤创建一个反应应用程序:
And I get this error:我得到这个错误:
In error have suggestion to remove webpack dependency but i cant do that because in file package.json dun have that.错误地建议删除 webpack 依赖项,但我不能这样做,因为在文件 package.json 中没有那个。 Here my package.json这是我的 package.json
For additional information:如需更多信息:
Do step number 6 and delete that babel loader or webpack folder and you will be good afterwards.执行第 6 步并删除那个 babel loader 或 webpack 文件夹,之后你会很好。 Chances are you have an outdated web pack or babel that you installed in a previous project.您可能有一个过时的 web pack 或 babel,是您在之前的项目中安装的。
I just had this very issue, and turns out to be something simple我刚刚遇到了这个问题,结果很简单
The part of the log that says about there being a日志中说明存在一个
"a different version of webpack was detected higher up in the tree" “在树的更高位置检测到不同版本的 webpack”
looks to be the same case for you.看起来和你一样。 I think you may have ran npm install
at some point under D:\\bolehDiHapus and so have node_modules installed further up the tree that you meant.我认为您可能已经在 D:\\bolehDiHapus 下的某个点运行了npm install
,因此将 node_modules 安装在您所指的树的更远的位置。
I simply changed the name of D:\\bolehDiHapus\\node_modules (probably best to just delete it) and hey presto npm start
works.我只是更改了 D:\\bolehDiHapus\\node_modules 的名称(可能最好只是删除它),嘿,presto npm start
有效。
I had this same issue, first it started saying we found the wrong version farther up in the tree, and then i had to delete webpack up there, and then i had install their "required version" even if it is lower than latest.我遇到了同样的问题,首先它开始说我们在树中更远的地方找到了错误的版本,然后我不得不删除那里的 webpack,然后我安装了他们的“所需版本”,即使它低于最新版本。
npm install webpack@version --save
in your case: npm install --save webpack@4.19.1
在你的情况下: npm install --save webpack@4.19.1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.