• Categories
    • Unread
    • Recent
    • Popular
    • Users
    • Groups
    • Register
    • Login

    How to install Node.js and NPM on Ubuntu based Operating Systems

    Scheduled Pinned Locked Moved General Computing
    installnode.jsnpmubuntu
    1 Posts 1 Posters 570 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ScuzzS Offline
      Scuzz
      last edited by Scuzz

      While I am setting up Node.js and NPM for a project I am currently working on I think it would be best to document my installations setups. I have already posted a quick How to Install Nginx and i think Node.js and NPM are the next logical items to write about.

      Installing Node.js

      sudo apt-get update
      sudo apt-get install nodejs
      

      This will install whatever version is currently in the repository, this will probably not be the latest and we will need to upgrade. Once the installation is complete you should have a working version of Node.js and NPM. NPM is Node Package Manager and it is used to install different node packages. It can also be used to upgrade itself and Node.js.

      How to upgrade NPM

      If NPM is not installed with the Node.js install then you will need to install NPM via apt-get.

      sudo apt-get install npm
      sudo npm update npm -g
      

      This command will upgrade NPM to the latest version, the -g is a global option so unless you are a root user you will need to use the sudo command.
      Once NPM has been fully update you can use it to update Node.js.

      How to upgrade Node.js via NPM

      sudo npm install -g n
      sudo n stable
      

      This will install the latest version Node.js.
      After these commands have run you will have a fully working and up to date Node.js and NPM.

      1 Reply Last reply Reply Quote
      • 1 / 1
      • First post
        Last post
      Online Users