1

I want to install node to run Angular2 program, but while installing I am getting this error:

npm WARN npm npm does not support Node.js v0.10.25
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN using --force I sure hope you know what you are doing.

/usr/local/lib/node_modules/npm/lib/cache.js:3
const BB = require('bluebird')
^^^^^
npm ERR! Use of const in strict mode.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/swapnily/.npm/_logs/2017-07-04T10_51_42_147Z-debug.log  

I've already tried this solution:

sudo npm cache clean -f  
sudo npm install -g n  
sudo n stable  

but even for first command "sudo npm cache clean -f" I am getting same issue. Please let me know if anyone aware about same.

Lazyexpert
  • 3,106
  • 1
  • 19
  • 33
Swapnil Yeole
  • 406
  • 3
  • 12
  • 26

3 Answers3

1

I, personally, am a huge fan of nvm. It makes node installation and versions manipulations so easy.

All install instructions can be found here.

I'll just give an example command of installing new nodejs version and start using it, so you understand how clear and easy it is:

nvm install 8.0
nvm use 8.0
Lazyexpert
  • 3,106
  • 1
  • 19
  • 33
0

I suggest you download the Node archive from official site(https://nodejs.org/en/

After that, you need the create a soft link to the bin file you just download from the site, the command line words may like this:

ln -s /opt/node-v6.10.2-linux-x64/bin/node /usr/bin/node

Same for npm

JWang
  • 181
  • 6
0
$ sudo apt update  
$ sudo apt install node.js

To check the version of Node:

 $node -v 

Installing Using a PPA; to get recent version of Node.js you can add the PPA (personal package archive) maintained by NodeSource. This will have more up-to-date version of Node.js than the official ubuntu repositories, and will allow you to choose between Node.js c6.x (which is supported until April of 2019), Node.js v8.x (the current LTS version, supported until December of 2019), and Node.js v10.x (the latest version, supported until April of 2021).

First, install the PPa in order to get access to its contents. From your home directory, use curl to retrieve the installation scripts for your preferre version, making sure to replace 8.X with your preferred version string (if different)

Check this link to continue: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04?

Majd.aj
  • 1
  • 4