设置 REACT 环境时出错

发布于 2025-01-11 19:11:09 字数 775 浏览 0 评论 0原文

我尝试使用“sudo npm install -g expo-cli”通过终端在我的 Mac 上安装 React Native,但在安装结束时出现错误。


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

31 vulnerabilities (19 moderate, 12 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

在尝试安装 React Native 之前,我显然安装了最新版本的 NodeJS (16)。 有人知道为什么安装不起作用吗?

当我执行“npmauditfix”时,它是这样说的:

npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file

提前感谢您的帮助。

I'm trying to install react native on my Mac through the terminal using "sudo npm install -g expo-cli" but at the end of the installation errors appear.


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

31 vulnerabilities (19 moderate, 12 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

Before trying to install react native I obviously installed nodeJS (16) in its latest version.
Anyone have an idea why the installation doesn't work?

when I do "npm audit fix" this is what it says:

npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file

Thank you in advance for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

<逆流佳人身旁 2025-01-18 19:11:09

好消息!

您引用的第一个块表示安装失败。您的软件包已正确安装。这些警告针对的是嵌套安全漏洞,您可以选择解决或忽略这些漏洞,具体取决于您的应用程序。

要证明它已安装,请在终端中运行 npm list -g 并查看 expo-cli 是否在列表中。

Good news!

The first block you're referring to does not indicate installation failure. Your packages were installed correctly. The warnings are for nested security vulnerabilities which you can choose to address or ignore, depending on your app.

To prove that it was installed, run npm list -g in your terminal and see if expo-cli is in the list.

甲如呢乙后呢 2025-01-18 19:11:09

您还可以通过使用npmauditfix创建新的react应用程序来检查正确安装的软件包,

npx create-react-app my-app
cd my-app
npm start

旨在自动升级/修复npm软件包中的漏洞

You can also check the packages installed correctly by creating a new react app using

npx create-react-app my-app
cd my-app
npm start

npm audit fix is intended to automatically upgrade / fix vulnerabilities in npm packages

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文