设置 REACT 环境时出错
我尝试使用“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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好消息!
您引用的第一个块不表示安装失败。您的软件包已正确安装。这些警告针对的是嵌套安全漏洞,您可以选择解决或忽略这些漏洞,具体取决于您的应用程序。
要证明它已安装,请在终端中运行
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 ifexpo-cli
is in the list.您还可以通过使用
npmauditfix
创建新的react应用程序来检查正确安装的软件包,旨在自动升级/修复npm软件包中的漏洞
You can also check the packages installed correctly by creating a new react app using
npm audit fix
is intended to automatically upgrade / fix vulnerabilities in npm packages