阻止create_react_app重新安装全局软件包

时间:2019-06-13 14:01:55

标签: reactjs create-react-app

我不确定每次使用create_react_app时该怎么做

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

即使我已检查全局安装位置中已经存在react, react-dom, and react-scripts个软件包。

如何阻止create_react_app重新安装全局安装的软件包?

1 个答案:

答案 0 :(得分:1)

create_react_app使用npm,对于npm软件包,仅当它提供可从Shell(CLI)运行的可执行命令时,才应全局安装。这是npm将所有应用程序包保留在node_modules内以避免冲突的方式,与以前使用捆绑器之类的东西相比,npm有所不同。因此,简单的答案就是正确的npm方式,即使看起来像浪费资源,也不需要更改它