我在使用创建react应用程序时遇到了问题,我一直收到错误。我正在使用node 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.发布于 2021-04-17 16:33:44
运行以下命令清除纱线缓存后:
yarn cache clean正在删除AppData文件夹中的纱线缓存文件夹以及C:\Users\test\AppData\Local\Yarn
然后,后续调用:
npx create-react-app your-app这对我很有效
https://stackoverflow.com/questions/56637334
复制相似问题