简体   繁体   English

有没有办法离线使用create-react-app

[英]Is there a way to use create-react-app offline

I would like to know if there's a way to use create-react-app offline rather than have it download files from the inte.net everytime.我想知道是否有办法离线使用 create-react-app 而不是每次都从 inte.net 下载文件。 Doing this, seems like a huge waste of bandwith, and time, as inte.net speed is very slow and expensive where i reside.这样做似乎是对带宽和时间的巨大浪费,因为在我居住的地方,互联网速度非常缓慢且昂贵。

Now there is an NPM package for that it called create-react-app-offline Installation :现在有一个名为create-react-app-offline Installation 的NPM 包

npm i - g create-react-app-offline

Usage :用法 :

crao -n <app-name>

For more informations on GitHub有关GitHub的更多信息

Every-time you do npm i, it also checks for updated packages and updates your package.json .每次你执行 npm i 时,它也会检查更新的包并更新你的 package.json 。 The app can be made offline but your node modules will be downloaded ( they are added to git ignore) if you upload them to git.该应用程序可以离线,但如果您将它们上传到 git,您的节点模块将被下载(它们被添加到 git ignore)。

If net is really an issue there then I'd suggest getting a pen drive or something where you can upload your files and access them without re-downloading如果网络确实是一个问题,那么我建议您购买一个笔式驱动器或其他可以上传文件并在不重新下载的情况下访问它们的东西

I found a npm package called create-react-app-offline which initializes the react project offline.我找到了一个名为 create-react-app-offline 的 npm 包,它可以离线初始化 react 项目。 And I checked it myself.我自己检查过。 Here's the link这是链接

Create React App Offline Package创建 React App 离线包

Just install it globally and run the crao -n <app_name>只需全局安装并运行 crao -n <app_name>

I'm currently using the create-react-app-offline package and I recommend you to stop using it, because the dependencies are out dated我目前正在使用create-react-app-offline package 我建议您停止使用它,因为依赖项已过时

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM