这是我第一次在这里发帖,如果我不遵守一些规则或格式错误,请道歉。我正在使用React Native和Expo制作应用程序,当我试图安装bug时,我得到这个错误。
$ npx bugsnag-expo-cli init
√ @bugsnag/expo does not appear to be installed, do you want to install it? ... yes
√ If you want the latest version of @bugsnag/expo hit enter, otherwise type the version you want ... latest
√ Using yarn or npm? » npm
> Installing @bugsnag/expo with npm. This could take a while!
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
您是否尝试在Windows上运行bugsnag-expo-cli
?Expo CLI目前只支持MacOS和Linux操作系统:https://docs.bugsnag.com/platforms/react-native/expo/安装和配置
作为CLI的替代方法,您可以遵循手动集成指南:https://docs.bugsnag.com/platforms/react-native/expo/manual-setup/
在我的例子中,清理缓存解决了这个问题(MacOS)
npm cache clean --force