更新了Ionic CLI,但显示了以前的版本(Windows) [英] Updated Ionic CLI but shows previous version (Windows)
问题描述
我想将Ionic CLI工具更新为最新版本(v1.3.13). 我这样做:
I want to update the Ionic CLI tool to the latest version (v1.3.13). I do this:
npm update -g ionic
它似乎起作用.没有错误,它将成功获取所有文件.
It appears to work. No errors, it gets all the files successfully.
但是-我这样做:
ionic --version
它显示了以前的版本!为什么?
And it shows the previous version! Why?
推荐答案
结果证明我去年安装了Ionic,但在本地安装了.
我已将其安装在C:\ Users \ myusername \ Documents \ Nodejs目录中.
Turns out I had installed Ionic last year, but locally.
I had installed it in C:\Users\myusername\Documents\Nodejs directory.
我从此目录中删除了这些文件:
I removed these files from this directory:
- ionic
- ionic.cmd
这是\ node-modules目录中的文件夹:
And this folder in the \node-modules directory:
- ionic
执行完此命令后,
ionic --version
...由于它已成功安装在全局空间(AppData \ Roaming \ npm)中,因此显示了正确的版本.
...it displayed the correct version, due to it being successfully installed in the global space (AppData\Roaming\npm).
希望这对其他Windows用户有帮助.
Hope this helps other Windows users.
这篇关于更新了Ionic CLI,但显示了以前的版本(Windows)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!