我正在尝试使用 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.
最佳答案
在我看来像是网络问题。你可能在代理后面。如果是这样,请像这样在 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/