Can't Upgrade Ionic Version on Ubuntu - node.js

I'm trying to update my Ionic Cli from 6.12.2 to the latest version (6.19.0). I'm using Ubuntu. I was able to update node.js to the latest version, but when I run the commands:
npm uninstall -g ionic
npm uninstall -g #ionic/cli
with or without sudo command, when I run ionic -v again, it still say that I have the version 6.12.2 of ionic. and when I run npm install -g #ionic/cli and then run ionic -v it still say the same. Those commands are not being able to remove ionic from my Ubuntu.
That is something like a cache folder on ubunt that I should delete from system, related with the ionic cli, or something like that? Because I was not able to do this following the documentation on website.

To work around the problem, you can install the latest version from tarball:
cd /tmp
wget https://registry.npmjs.org/#ionic/cli/-/cli-6.19.0.tgz
sudo npm -g install cli-6.19.0.tgz

Related

Install angular on mac

I'm trying to install Angular on macOS. I have npm 5.6.0 and node 8.11.1 installed. I tried sudo npm install -g #angular/cli, which seems to install it. However, when I type ng --version, I get:
Unknown error: ReferenceError: Invalid left-hand side in assignment
Edit: I also tried this, to no effect:
npm uninstall -g angular-cli
npm cache clean or npm cache verify (if npm > 5)
npm install -g #angular/cli#latest
You can use the macOS package manager. In your terminal type:
brew install angular-cli
To confirm your version:
ng --version
I think the best way to install angular on mac is using brew.
1.) Install brew, by typing the following command on your terminal :-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2.) After Installing brew, then run following command :-
brew install angular-cli
After Installation, you'll see angular is successfully installed.
To check, Type Command :-
ng version
Delete npm and node, then install them via brew (works perfect on mac os).
See https://brew.sh/

Ionic Installation via npm

I am facing an error while installing cordova and ionic each and everytime. As I start my installation using npm install -g cordova ionic. The installation cursor keeps on rotating like for many minutes and then I have to explicitly terminate the installation. Please help me with this issue.
you can try
npm --loglevel info install -g cordova ionic
and it should tell you more about what is happening / where the installation process stalls.
try npm install -g cordova first followed by npm install -g ionic
also you may need to install other missing components if any, CLI will intimate you very nicely.
What the command:
npm install -g cordova
ionic does is tries to install the cordova and ionic in a sequential order and -g manages the environment variables as well.
So, i recommend you to first install cordova then ionic.
npm install -g cordova,
npm install -g ionic,
Furthermore, i prefer using gitbash CLI rather than the cli provided by default.
It handles the issues of bower installation which may appear afterwards.And if you want a complete guide from installing to building an android project you can try the steps of the blog from here.
Good Luck.
Using cache help me to face this issue with following command :
npm install -g cordova ionic --cache "c:\path\to\use\as\dependencies\cache"

Start with fresh copy of node, npm and cordova

I had a makeshift setup on Lubuntu that 'functioned' with sudo npm install. I used Ionic Framework generator to create projects and they functioned as well as the builds and deployment.
I upgraded to 15.04 and ever since had problems finding a solution that worked does not give EACCESS errors or grunt serve telling me
Upgrade warning - for the CLI to run correctly,
it is highly suggested to upgrade the following:
Please update your Node runtime to version >=0.12.x
Please update your Cordova CLI to version >=4.2.0 npm install -g cordova
then for npm install -g cordova to tell me
npm WARN engine cordova-serve#0.1.3: wanted: {"node":">= 0.12.0","npm":">= 2.5.1"} (current: {"node":"0.10.26","npm":"2.12.1"})
I have tried the "chown -R whoami /dir/of/npm"
I have delete npm, node install brew and created new installs for all.
I still get EACCESS errors, my yo ionic "grunt serve" deploys the browser but gives ERR_CONNECTION_REFUSED
I installed brew, manually deleted the npm folder and did a clean install. No joy
which node - /home/username/.nvm/v0.10.26/bin/node
node -v v0.10.26
which npm - /home/userna/.linuxbrew/bin/npm
npm -v 2.12.1
which cordova - /usr/local/bin/cordova
cordova -v 3.5.0-0.2.6
And for good meassure i thought if i installed node4 all my troubles would disappear.
I know i messed this up but i would like a clean start with node, npm(without sudo) and cordova. Any help would be appreciated
Ps: I have done most of the normal suggestions hence my question.
Did you installed node using nvm?
So try
nvm use 4.0.0
In general:
nvm install [VERSION]
nvm use [VERSION]
To use permanent:
nvm alias default [VERSION]
try also to install cordova again after updating node
npm install -g cordova
If all fails:
Uninstall node and reinstall propper using brew:
cd ~
sudo rm -rf .npm
brew update
brew uninstall npm
brew install npm

phonegap - nothing happend on npm install -g phonegap

I've been trying to install phonegap with no luck.
I've already installed nodejs using:
sudo apt-get install node
But when I tried to run the following, nothing was outputted to the terminal. See attached image.
sudo npm install -g phonegap
Package name should be "nodejs" not "node".
Also make sure npm is installed by typing :
npm -v
in terminal.
Please read Installing Node.js via package manager for Node.js & NPM installation.

Apache Cordova - uninstall globally

I've installed cordova via npm and i did it globally, now i would like to remove it to reinstall it on single app folder
Any clue on how to do it safely?
Try sudo npm uninstall cordova -g to uninstall it globally and then just npm install cordova without the -g flag after cding to the local app directory
Try this for Windows:
npm uninstall -g cordova
Try this for MAC:
sudo npm uninstall -g cordova
You can also add Cordova like this:
If You Want To install the previous version of Cordova through the Node Package Manager (npm):
npm install -g cordova#3.6.3-0.2.13
If You Want To install the latest version of Cordova:
npm install -g cordova
Enjoy!
Super late here and I still couldn't uninstall using sudo as the other answers suggest. What did it for me was checking where cordova was installed by running
which cordova
it will output something like this
/usr/local/bin/
then removing by
rm -rf /usr/local/bin/cordova
This can happen when the cordova was installed globally on a different version of the node.
Being necessary to manually delete yourself as suggested in the previous comment:
which cordova
it will output something like this
/usr/local/bin/
then removing by
rm -rf /usr/local/bin/cordova
worked for me:
which cordova
/opt/homebrew/bin/cordova
rm -rf /opt/homebrew/bin/cordova

Resources