Node.js &引用;npm安装expo cli--全球;不起作用

Node.js &引用;npm安装expo cli--全球;不起作用,node.js,reactjs,react-native,npm,expo,Node.js,Reactjs,React Native,Npm,Expo,我正在尝试安装expo cli,但由于某些原因,我遇到了此错误 npm WARN deprecated joi@14.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patc

我正在尝试安装expo cli,但由于某些原因,我遇到了此错误

npm WARN deprecated joi@14.0.4: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm ERR! Unexpected end of JSON input while parsing near '...":{"caniuse-db":"^1.0'
我也尝试 npm安装expo cli-g--不安全的perm

npm install expo cli-g--unsafe perm=true--allow root


但这也不起作用。如何解决此问题?

admin
sudo
的身份打开终端

检查npm的注册表,它应该是
https://registry.npmjs.org/

Npm使用缓存为您下载新包。您需要清除npm缓存。使用以下命令进行清理和安装:

npm cache clean --force
npm install -g expo-cli
这对我有用。

这对我有用