发生意外错误:“https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz:请求失败\“404 Not Found\”
Posted
技术标签:
【中文标题】发生意外错误:“https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz:请求失败\\“404 Not Found\\”【英文标题】:An unexpected error occurred: "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz: Request failed \"404 Not Found\"发生意外错误:“https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz:请求失败\“404 Not Found\” 【发布时间】:2020-05-28 15:43:13 【问题描述】:当我尝试使用 create-react-app 创建一个新的 react 应用程序时,我得到了以下信息:
» npx create-react-app my-order
Creating a new React app in /Users/ian/myproject/my-order.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.19.0
[1/4] ???? Resolving packages...
[2/4] ???? Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz: Request failed \"404 Not Found\"".
info If you think this is a bug, please open a bug report with the information provided in "/Users/ian/myproject/my-order/yarn-error.log".
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 /Users/ian/myproject/my-order has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
而我的本地环境信息是这样的:
» npx create-react-app --info
Environment Info:
System:
OS: macOS 10.14.6
CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Binaries:
Node: 11.1.0 - /usr/local/bin/node
Yarn: 1.19.0 - ~/.yarn/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Browsers:
Chrome: 80.0.3987.100
Firefox: 72.0.2
Safari: 12.1.2
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: 2.1.1
有人知道这里发生了什么吗?
【问题讨论】:
【参考方案1】:在你的命令中试试这个: - 纱线缓存清理 - 纱线 它可能会工作......
【讨论】:
出现意外错误:“EBUSY:资源繁忙或锁定,rmdir '/home/sandbox/.cache/yarn'”。【参考方案2】:有时访问 npmjs.com 和安装范围包时会出现问题。试试看https://status.npmjs.org/
【讨论】:
【参考方案3】:如果您使用 NVM,如果您从最初安装的主要 nodejs 版本切换出去,则可能会出现此问题,因此请尽可能改回:nvm use <original node installation's version>
但是,如果这对您不起作用,那么如果我不能只使用非 NVM 安装,那么我会尝试直接从网站重新安装节点:https://nodejs.org/en/
对于某些人来说,他们似乎遇到了 EACCESS 错误,这可以通过将他们的注册表从 http 更改为 https 来解决:npm install --registry=https://registry.npmjs.org/
类似问题:Cannot run npm install from nvm, but working well using source from https://nodejs.org/en/download/
【讨论】:
以上是关于发生意外错误:“https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz:请求失败\“404 Not Found\”的主要内容,如果未能解决你的问题,请参考以下文章
发生意外错误:“https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz:请求失败\“404 Not Found\”