I am using ubuntu 15.10
ionic version 1.7.15.
I was trying to update my nodejs to laters version 6 and npm and after that when i run ionic server command i am getting error shown in
the command i used to update
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
how to to downgrade my nodejs
when i use whereis node command
node: /usr/local/bin/node /opt/node/bin/node
when i use whereis nodejs command
nodejs:
when i use whereis npm command
npm: /usr/local/bin/npm /opt/node/bin/npm
I think i have to use lower version of node but i dont know how to do is i have tried my cmd but no use
I solved this issue by mention the version of node
sudo npm cache clean -f
sudo npm install -g n
sudo n v4.2.3 //By mentioning the version while i install i solved this error on serve
i switched my node version from v6 to v4 so then i got no error
Related
Im trying to downgrade my node version so I run on terminal on mac
sudo npm cache clean -f
sudo npm install -g n
sudo n 9.10.0
then I try to check the version and it still as last version
npm -v
=> 5.6
node -v => v10.11.0
in addition when I run the commands above I get this errors
Maybe you can use https://github.com/creationix/nvm for get several versions in your PC
Whenever I enter ng in termial, it outputs
You are running version v6.14.3 of Node.js, which is not supported by
Angular CLI v6. The official Node.js version that is supported is 8.9
and greater.
Please visit https://nodejs.org/en/ to find instructions on how to
update Node.js
How to fix this issue?
This happens only in non root user account, works fine with root account
Your error message indicates, that your node version is not supported by angular.
So you should rather update node.
The current LTS is 8.11.3 which you can download here:
https://nodejs.org/en/
I've been using 'nvm' for this, it is a node version manager that allows you to install and switch between node versions very easily.
You can find it here:
https://github.com/creationix/nvm/blob/master/README.md
I was using nodejs v4.2.6 and npm v3.10.10
When I ran npm install -g #angular/cli, I think it tried to install latest version of angular-cli, hence I was getting this error.
You are running version v6.14.3 of Node.js, which is not supported by Angular CLI v6. The official Node.js version that is supported is 8.9 and greater.
Due to some reason, I didn't wanted to upgrade to latest node and npm packages, so I resolved it by npm install -g #angular/cli#1.1.1
Use n module from npm in order to upgrade node
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
To upgrade to latest version (and not current stable) version, you can use:
sudo n latest
To undo:
sudo apt-get install --reinstall nodejs-legacy # fix /usr/bin/node
sudo n rm 6.0.0 # replace number with version of Node that was installed
sudo npm uninstall -g n
Found in David Walsh blog
I tried to install node.js by NVM in Ubuntu 16.04 server by following this link. And I got:
root#instance-15s8fbzx:/opt# nodejs --version
v4.2.6
root#instance-15s8fbzx:/opt# npm --version
5.3.0
root#instance-15s8fbzx:/opt# node --version
v8.4.0
Then, we I run a mean-stack project by sudo npm start, I got
class User {
^^^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Then, I saw this link, I think maybe because the nodejs version is not correct. I have another server with v5.12.0 as the version of nodejs, and the project worked well there.
Then, I tried to do
sudo npm install -g npm
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/8.4.0/bin/node /usr/bin/node
But the version of the nodejs is still 4.2.6. Does anyone know how to upgrade its version to 5.12.0?
After you have installed NVM and you have installed the necessary version of node, you select the node version as follows:
> nvm use v5.12.0
After upgrading to the Nodejs version, the following error occurred for the Laravel and VUE js packages I already had:
PHP Fatal error: During inheritance of IteratorAggregate: Uncaught
ErrorException: Return type of
Symfony\Component\HttpFoundation\ParameterBag::getIterator() should
either be compatible with IteratorAggregate::getIterator():
Traversable, or the #[\ReturnTypeWillChange] attribute should be used
to temporarily suppress the notice in
C:\xampp\htdocs\clerk\vendor\symfony\http-foundation\ParameterBag.php:210
To solve the issue, I did the following:
composer update
npm update
npm run dev
php artisan serve
I have installed node and npm using following command in my Ubuntu machine:
sudo apt-get install nodejs npm
On checking version of installed, I could see following:
$ node -v && npm -v
v0.10.25
1.3.10
But I want nodejs version to be 4.2.0 or above. I am trying to install VSO Linux agent for a project. On executing node agent/vsoagent, I get error that node version should be 4.2.0 or above.
How do I install it and also make sure that the already installed ones are removed with node -v && npm -v gives me new version number?
Thanks
You already have npm, so you can use n manager to install any version you want (4.4.4 for ex): maybe you should use sudo for global install:
npm install -g n
n 4.4.4
Or
n latest
After that you can just run n to select version that you prefer. I use latest LTS and latest 6.x side-by-side and switching them anytime i want.
I have trouble upgrading Node.js.
Currently, I have node --version "v0.8.18" and I would like to upgrade to the latest "v0.10.20". So I followed some answers that does not include NVM, since I want to know how to do it from scratch. However, after trying, I still get node --version "v0.8.18".
I am on an Ubuntu 11.04 machine, on my home directory.
Specifically I did:
Try 1:
alice#simba:~$ node --version
v0.8.18
alice#simba:~$ sudo n stable
sudo: n: command not found
alice#simba:~$ sudo npm install n -g
npm http GET https://registry.npmjs.org/n
npm http 200 https://registry.npmjs.org/n
npm http GET https://registry.npmjs.org/n/-/n-1.1.0.tgz
npm http 200 https://registry.npmjs.org/n/-/n-1.1.0.tgz
/usr/bin/n -> /usr/lib/node_modules/n/bin/n
n#1.1.0 /usr/lib/node_modules/n
alice#simba:~$ sudo n stable
install : 0.10.20
mkdir : /usr/local/n/versions/0.10.20
fetch : http://nodejs.org/dist/v0.10.20/node-v0.10.20-linux-x64.tar.gz
...
...#############/usr/bin/node
installed : v0.10.20
alice#simba:~$ node --version
v0.8.18
Try again:
alice#simba:~$ npm cache clean -f
alice#simba:~$ sudo npm install n -g
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
n#1.1.0 /usr/local/lib/node_modules/n
alice#simba:~$ n stable
/usr/local/bin/node
alice#simba:~$ sudo n stable
/usr/local/bin/node
alice#simba:~$ node --version
v0.8.18
I use nvm myself, but something I've bumped up against in the past is that installing a version and selecting a version as active are different operations.
It may be that your new version is installed but not currently the default. Try:
n use 0.10.20