node.js - 在创建反应应用程序时,进程停止并显示 1 个漏洞(运行 npm 审计)
问题描述
运行 npx create-react-app app-name 时,进程在运行 npm audit fix 时自动停止,并且不显示任何错误
我也使用不同的命令来解决这个问题
update npm globally
npm install -g create-react-app
create-react-app my-app
或者
install yarn
yarn create react-app my-app
或者
npm cache clean --force
npx create-react-app my-app
但没有什么对我有用,它总是在运行 npm 审计漏洞时停止
PS D:\mern> npx create-react-app client
Creating a new React app in D:\mern\client.
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 D:\mern\client\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@3.6.5 postinstall D:\mern\client\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure@3.6.5 postinstall D:\mern\client\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
+ cra-template@1.0.3
+ react-scripts@3.4.1
+ react@16.13.1
+ react-dom@16.13.1
added 1626 packages from 750 contributors and audited 1630 packages in 257.371s
59 packages are looking for funding
run `npm fund` for details
解决方案
好吧,您可以运行npm audit fix
以尝试修复它。有些项目确实有 1 个或多个漏洞,可悲的是,这是正常的,如果npm audit fix
没有帮助,请尝试npm audit fix --force
。
[编辑] 另外,如命令输出所述:
添加了来自 750 个贡献者的 1626 个包,并在 257.371 秒内审核了 1630 个包
添加了软件包,没有错误,只是关于最近添加的 1626 个软件包中的一个漏洞的警报。
因此,如果您不关心那个漏洞,您可以编译您的项目。
推荐阅读
- vim - 从同一个字符(= 符号)开始的多行编辑[没有宏?]
- python - 打开目录中的所有文件以测试条件
- r - 如何使用基于成对欧几里得距离向量的核函数分配权重?
- java - 如何在 Java 中连接 1 个数组和字符串?
- java - 为什么我在此程序中收到 ArrayIndexOutOfBoundsException 错误?
- linux - Docker:从 Win10 挂载到运行 ubuntu 的容器的 dir 中不允许 git 操作
- javascript - 希望让我的机器人接收消息,并使用 Discord.js 转换字母
- python-3.x - selenium alert 使用 IE 驱动程序自动单击接受
- c - C语言程序以不同的颜色开始
- python - 如何在 Django admin 中更改对象的名称?