更新全局程序包运行,但不更新

时间:2019-07-24 20:39:14

标签: npm yarnpkg

为React Native项目运行expo start告诉我进行更新:

$ expo start
┌─────────────────────────────────────────────────────────────┐
│                                                             │
│   There is a new version of expo-cli available (3.0.4).     │
│   You are currently using expo-cli 2.21.1                   │
│   Run `npm install -g expo-cli` to get the latest version   │
│                                                             │
└─────────────────────────────────────────────────────────────┘

所以,我更新了:

$ sudo npm i -g expo-cli
Password:
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 WARN deprecated @babel/polyfill@7.4.4: ? As of Babel 7.4.0, this
npm WARN deprecated package has been deprecated in favor of directly

... lots of similar warnings...

+ expo-cli@3.0.4
updated 1 package in 65.302s

但是,它实际上尚未更新:

$ expo-cli -V
2.21.1

如果我尝试yarn,也会发生同样的事情。安装运行,并以新版本号结束,但是检查版本是否为旧版本,然后运行命令确认它尚未更新。

我以前遇到过这个问题,并最终以某种方式使它起作用。我相信尝试this会有所帮助,按照这些说明,我的~/.profile看起来像这样:


# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export PATH=~/.npm-global/bin:$PATH
export PATH=~/.yarn-global/bin:$PATH

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

我该如何解决?

FYI:npm 6.10.0,纱线1.15.2,节点11.12.0

0 个答案:

没有答案