成功安装后找不到软件包 [英] Package failing to be found after successful install
问题描述
我尝试运行expo optimize
,它说它需要sharp-cli
.
I try to run expo optimize
and it says it requires sharp-cli
.
所以我直接安装了sharp-cli
.
然后它给了我同样的错误.
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-cli
会告诉我运行expo
命令时有一个新版本,无论我安装了多少次.看起来类似的问题.
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
安装也无法修复.
推荐答案
您可以尝试在本地安装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屋!