【发布时间】:2019-06-17 18:57:51
【问题描述】:
我在使用创建 React 应用程序时遇到问题,我不断收到错误消息。
我正在使用节点 v10.16.0 和 npm v 6.9.0
我已经浏览了很多答案,并尝试了所有建议,包括重新安装节点、清除缓存等。
我在命令提示符中输入了npx create-react-app client
这就是我得到的。
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.16.0
[1/4] Resolving packages...
error Received malformed response from registry for "react". The registry may be down.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd C:\Users\xxxx\Documents\Work Project\client has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting client/ from C:\Users\xxxx\Documents\Work Project
Done.
【问题讨论】:
-
使用yarn代替npm安装包
-
npx create-react-app client在这里为我工作得很好(相同的节点和 npm 版本,但在 mac 上)。也许是你所在的网络?试试别的电脑? -
使用纱线给我这个错误
error Received malformed response from registry for "mobx-react". The registry may be down. -
似乎您正在将纱线与 npm 混合使用。创建一个新文件夹,然后仅使用 npx create-react-app 项目名称
-
我得到了与上面我的问题中写的相同的错误。
标签: reactjs npm create-react-app