0
~/nodecode$ sudo apt-get install 

npm is already the newest version. 0 to upgrade, 0 to newly install, 0 to remove and 17 not to upgrade.> Done Building dependency tree Reading state information...

Having established that npm is installed I don't know why none of the listed commands do anything. What am I missing?

  • run these commands add the output to your question: whereis npm, which npm – Ravexina Apr 16 '17 at 22:19
  • npm: /usr/bin/npm /usr/bin/X11/npm /usr/local/bin/npm /usr/share/npm /usr/share/man/man1/npm.1.gz /usr/share/man/man3/npm.3.gz and /usr/local/bin/npm man npm : VERSION 4.3.0 – JohnnyBizzle Apr 17 '17 at 12:18
  • everything is ok. what if you ran /usr/bin/npm --version or /usr/bin/npm -v – Ravexina Apr 17 '17 at 12:59
  • /usr/bin/npm -v returns: 1.3.10 – JohnnyBizzle Apr 18 '17 at 14:01
  • I stopped trying to develop locally now. I am using cloud services instead. – JohnnyBizzle Apr 10 '18 at 13:36
0
sudo su

root@PC_NAME:/home/# : sudo apt-get

You need to have nodecode folder in directory else you will get

bash: /root/nodecode$: No such file or directory

Info:

apt-get is a command line interface for retrieval of packages and information about them from authenticated sources and for installation, upgrade and removal of packages together with their dependencies.

npm is installed with Node.js npm is distributed with Node.js- which means that when you download Node.js, you automatically get npm installed on your computer. For checking the version of npm

StepI Install your nodejs

https://nodejs.org/en/

Ubuntu

Run the following on your command line to install the source for nodejs

curl -sL https://deb.nodesource.com/setup | sudo -E bash -

Then, run this to get the latest nodejs package

sudo apt-get install -y nodejs

Step II Check that you have node and npm installed

To check if you have Node.js installed, run this command in your terminal:

node -v

To confirm that you have npm installed you can run this command in your terminal:

npm -v

A note on versions

npm versions

npm is a separate project from Node.js, and tends to update more frequently. As a result, even if you’ve just downloaded Node.js (and therefore npm), you’ll probably need to update your npm. Luckily, npm knows how to update itself! To update your npm, type this into your terminal:

npm install npm@latest -g

Node versions and Long Term Support Node.js has lots of versions! To use Node.js, and therefore npm, effectively, you’ll want to make sure that you are on a version that is supported by the Node.js team. In general, you should use the version of Node.js labelled “LTS”.

Use a Node.js version manager Software is always changing, and so it’s often a good practice to use a version manager to help account for this change. For this reason (and many others!) we recommend that you use a version manager for your Node.js installation. There are many great options; here are a few*:

NVM

nodist

n

nave

All References from

enter link description here

  • I will recommend you to update to 16.04 LTS – Koustubh G. Mar 7 '18 at 8:57

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.