This is not done by the script, but you want to make sure you see an entry that says something like this in the output (though the version might be different if you are not using 6.x as the version string the only thing we care about is that there's a newer version number provided via nodesource): Version table: If you get a NO_PUBKEY GPG error, then go back to Step 2 This refreshes the data from the nodesource repo so apt knows a newer version exists. Otherwise, you may get NO_PUBKEY errors with apt-get update (use wget in this command if curl isn't installed, and if neither are installed, install one of them): curl -s | sudo apt-key add. for newer Node versions)ĭownload the GPG Signing Key from Nodesource for the repository. (replace node_6.x with node_7.x or node_8.x, etc. You'll need to create this file with sudo, but when you create the file, put this inside it: deb xenial main Here's the manual way of making this work, and it is basically what the script does (except for Step 4, which is to make sure you are getting accurate version data):Ĭreate a new file: /etc/apt//nodesource.list Rather than rely on the script, we can do what the script is doing the old-school way: by hand, ourselves, set up the repository configuration and install NodeJS. ![]() The installation part is actually the sudo apt-get install step you ran by hand.Īlso of note: this will remove the npm package but that's because nodejs with this upstream packaging will include npm with it - no need for the npm package. I should point out: the script doesn't actually do any installing - all it does is determine the Debian/Ubuntu version you're on, and configure the repository for it to get data from. This just means we have to potentially do this a harder way. The fact you are seeing version 4.x getting installed means that the script didn't do its job right, so the script is not necessarily at fault. The script, therefore, may not have found your distribution, or it may have messed up when configuring the repository, or there may have been a network interruption, or any of a thousand reasons it was disrupted and didn't do its job. Therefore, thanks to the updated data from the OP which supports this, the data from the NodeSource repository was never seen by apt because it was not properly configured by the script. The core reason is that the setup script didn't run correctly. Results of apt-cache policy nodejs: apt-cache policy nodejs Update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode Processing triggers for man-db (2.7.5-1). Processing triggers for doc-base (0.10.7). ![]() 329473 files and directories currently installed.) Selecting previously unselected package nodejs. The following NEW packages will be installed:Ġ to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.Īfter this operation, 13.2 MB of additional disk space will be used. Use 'sudo apt autoremove' to remove them. Linux-signed-image-4.4.0-21-generic python-configobj python-pycurl Libssl-dev libssl-doc libuv1-dev linux-headers-4.4.0-18 Gyp libboost-python1.58.0 libjs-inherits libjs-node-uuid libjs-underscore The following packages were automatically installed and are no longer required: These are results after running sudo apt-get install -y nodejs: sudo apt-get install -y nodejs How do I install the latest stable version of node on Ubuntu 16.04? I thought perhaps setup_6.x should be setup_6.2.1, but that page returns a 404, see: These were my steps to install node on Ubuntu 16.04: curl -sL | sudo -E bash -Īfter doing this, running nodejs -version returns v4.2.6.Īs I used setup_6.x I was assuming a version beginning with 6 would be installed?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |