[英]Why does create-react-app give "Missing dependencies in package.json" message?
What's the problem:有什么问题:
I recently started learning reactjs.我最近开始学习 reactjs。 while creating a new react app, the build fails and only a package.json file is created.
在创建新的反应应用程序时,构建失败并且只创建了 package.json 文件。
> PS D:\react-projects> npx create-react-app app-name Creating a new
> React app in D:\react-projects\exercount.
>
> Installing packages. This might take a couple of minutes. Installing
> react, react-dom, and react-scripts with cra-template...
>
>
> added 1396 packages, and changed 1 package in 9m 203 packages are
> looking for funding run `npm fund` for details
> Missing dependencies in package.json
What I used:我用了什么:
when did i encounter it: I tried to create my first react app by following the reactjs official tutorial.我什么时候遇到它:我尝试按照 reactjs 官方教程创建我的第一个反应应用程序。 I opened vs code in administrator mode and ran the following command in the terminal
我以管理员模式打开 vs code 并在终端中运行以下命令
npx create-react-app myapp
while this worked fine in my friends linux laptop, it failed in my windows one.虽然这在我的朋友 linux 笔记本电脑上运行良好,但在我的 windows 笔记本电脑上却失败了。 All it does is throw a "Missing dependancies in package.json" message and only builds a folder with one package.json file.
它所做的只是抛出一个“package.json 中缺少依赖项”消息,并且只构建一个包含一个 package.json 文件的文件夹。
What have i tried:我试过什么:
All i found online were a few similar questions with only small number of them with answers.我在网上找到的只是一些类似的问题,只有少数有答案。 I have tried all of them and nothing worked.If you know what could be causing this, it would be helpful.
我已经尝试了所有这些,但没有任何效果。如果您知道可能导致这种情况的原因,那将会很有帮助。
Screenshots:截图:
I had the same.我有同样的。 The problem was resolved by downgrading npm to version 8.3.0
npm install -g npm@8.3.0
问题已通过将 npm 降级到版本 8.3.0
npm install -g npm@8.3.0
Were you able to find an answer to this problem?你能找到这个问题的答案吗? I'm having exactly the same result.
我得到完全相同的结果。 Thanks!
谢谢! Sherry
雪莉酒
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.