javascript - 在 Linux 16.04 中使用 create-react-app 创建应用程序失败

标签 javascript linux reactjs

我正在尝试使用 create-react-app 创建新应用。
以下是错误。
请帮忙。提前致谢

➜ REACT create-react-app my-app

Creating a new React app in /media/budi/Tjung/#TJUNG/REACT/my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "http://registry.npmjs.org/react: > ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/media/budi/Tjung/#TJUNG/REACT/my-app/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 /media/budi/Tjung/#TJUNG/REACT/my-app has failed.

Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting my-app / from /media/budi/Tjung/#TJUNG/REACT
Done.

error image at CLI

最佳答案

在我看来像是网络问题。你可能在代理后面。如果是这样,请像这样在 npm 中配置您的代理

npm config set proxy http://proxy_host:port

对于 https

npm config set https-proxy http://proxy.company.com:8080

注意:https-proxy 的协议(protocol)不是 https,而是 http。

你也可以试试,

npm config set strict-ssl false

检查这个 SO answer

关于javascript - 在 Linux 16.04 中使用 create-react-app 创建应用程序失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49919839/

相关文章:

javascript - 查询/CSS : Full size background image

python - 使用 scapy 和 IP 获取 MAC

javascript - 日期格式和时区 JS

javascript - 从 React bootstrap 中的另一个组件打开模式

javascript - 如何将 jQgrid 格式化函数中的对象参数分配给函数?

javascript - 如何让post请求在后台处理

javascript - 未捕获的类型错误 : Cannot set property 'innerHTML' of null

c - 防止进程在Linux上打开新的文件描述符,但允许通过套接字接收文件描述符

linux - 无法将tomcat升级到最新版本

javascript - 动态宽度测量 : ReactJS/NodeJS & HTML/CSS