安装成功后找不到包 [英] Package failing to be found after successful install

查看:31
本文介绍了安装成功后找不到包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试运行 expo optimize,它说它需要 sharp-cli.

I try to run expo optimize and it says it requires sharp-cli.

所以我按照它的指示安装 sharp-cli.

So I install sharp-cli as it directs.

然后它给了我同样的错误.

And then it gives me the same error.

(上述第一步省略)

$ npm install -g sharp-cli@1.10.0
/Users/TuzMacbookPro2017/.npm-global/bin/sharp -> /Users/TuzMacbookPro2017/.npm-global/lib/node_modules/sharp-cli/bin/cli.js
+ sharp-cli@1.10.0
updated 1 package in 24.632s
$ expo optimize
This will overwrite the original assets.
Optimizing assets...
Optimizing ./assets/electro-icon-1024.png
This command requires version 1.10.0 of `sharp-cli`. 
You can install it using `npm install -g sharp-cli@1.10.0`. 

For prerequisites, see: https://sharp.dimens.io/en/stable/install/#prerequisites
Set EXPO_DEBUG=true in your env to view the stack trace.

以前发生过这种情况,我可以通过重新启动终端或类似的方式来修复它.这次没有这样的运气.

This was happening before and I was able to fix it by restarting my terminal, or something like that. No such luck this time.

如果它有帮助,当我运行 expo 命令时,expo-cli 会告诉我有一个新版本,无论我安装了多少次新版本.类似的问题,似乎.

Also if it helps, expo-cli tells me there's a new version when I run an expo command, no matter how many times I install the new version. Similar problem, it seems.

使用 yarn global add 安装也没有修复它.

Installing with yarn global add didn't fix it either.

推荐答案

你可以尝试在本地安装 sharp-cli@1.10.0 吗?

Can you try installing sharp-cli@1.10.0 locally instead?

npm i -S sharp-cli@1.10.0

如果这不起作用,我会尝试清理您的缓存并重试:

If that doesn't work I would try cleaning out your cache and trying again:

npm cache clean --force

希望对您有所帮助!

这篇关于安装成功后找不到包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆