无法使用npx install命令创建反应应用程序

时间:2020-07-03 13:56:50

标签: javascript

我无法安装npx-react-app,因为它在以下位置停止了运行

Acer@LAPTOP-OTBULEBK MINGW64 ~/Desktop/coding (dev)   
$ npx create-react-app hello

Creating a new React app in C:\Users\Acer\Desktop\coding\hello.           

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

如果正在执行上述可停止步骤,则显示错误,如下所示

$ npx create-react-app hello

Creating a new React app in C:\Users\Acer\Desktop\coding\hello.

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


> core-js@2.6.11 postinstall C:\Users\Acer\Desktop\coding\hello\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> core-js@3.6.5 postinstall C:\Users\Acer\Desktop\coding\hello\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> core-js-pure@3.6.5 postinstall C:\Users\Acer\Desktop\coding\hello\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

+ react-scripts@3.4.1
+ react-dom@16.13.1
+ cra-template@1.0.3
+ react@16.13.1
added 1602 packages from 751 contributors and audited 1606 packages in 309.352s

60 packages are looking for funding
  run `npm fund` for details

found 4981 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

我安装了以下节点/ npm版本

Acer@LAPTOP-OTBULEBK MINGW64 ~/Desktop/coding (dev) $ node -v
v12.16.2
Acer@LAPTOP-OTBULEBK MINGW64 ~/Desktop/coding (dev) $ npm -v
6.14.4
Acer@LAPTOP-OTBULEBK MINGW64 ~/Desktop/coding (dev) $ npx -v
6.14.4

面对此问题后,我卸载了以上安装并安装了当前版本

Acer@LAPTOP-OTBULEBK MINGW64 ~/Desktop/coding (dev) $node -v
v14.5.0
Acer@LAPTOP-OTBULEBK MINGW64 ~/Desktop/coding (dev) $ npm -v
6.14.5

但仍然显示如上错误

1 个答案:

答案 0 :(得分:0)

之所以发生这种情况,是因为现在有些软件包实际上对在使用之前为其项目提供资金有一个微妙的需求。

npm添加了一个新命令npm fund <YOUR PACKAGE NAME>,该命令将列出所有需要资金的网站。

您可以使用以下方法跳过对其中任何一项的资助(不太好,但也不是强制开放资助):

npm install --no-fund <YOUR PACKAGE NAME>

为清楚起见,您可能需要阅读以下内容:https://docs.npmjs.com/files/npmrchttps://dev.to/ruyadorno/npm-6-13-0-7f3

让我知道这是否有帮助,如果没有帮助,我会与您一起解决。