【问题标题】:"npm install expo-cli --global" doesnt working“npm install expo-cli --global”不起作用
【发布时间】:2019-11-16 06:52:28
【问题描述】:

我正在尝试安装 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 install expo-cli -g --unsafe-perm

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

但这也不起作用。我该如何解决这个问题?

【问题讨论】:

标签: node.js reactjs react-native npm expo


【解决方案1】:

adminsudo 的身份打开终端。

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

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

npm cache clean --force
npm install -g expo-cli

它对我有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-21
    • 2022-08-19
    • 2019-12-11
    • 1970-01-01
    • 1970-01-01
    • 2016-11-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多