8/11/2019 Debian Install Npm
I am using Debian 9.3. (stretch) I cannot run 'npm' commands.
![]()
Output for
node -v
Install Nodejs using your distribution’s package manager (Stable, but outdated versions) Nodejs is available in the default repositories of most Linux distributions. It might not be latest version, but stable. If you want to have a stable Node.js on your Linux, you better install it using your distribution’s package manager as shown below.
Output for
nodejs -v
Output for
npm -v
I'm a newbie on Debian and I can't understand what's happening.
- I already reinstall Node.js - I already tried following the steps of the Official Page. - I already ran apt-get install npm Output E: Unable to locate package npm .- I was at Debian Testing and have the same error when I was there.
Thanks for read and help
- Melt
Orlando Cartagena
Orlando CartagenaOrlando Cartagena
4 Answers
Did you installed node js from their website? if that's not the case remove it
apt-get remove nodejs and install it from this link (follow this steps)https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
EDIT
After seing your version i realized that you are running an older version of nodejs... please remove the current nodejs version (V4.8.2) and install it via this link https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributionsIt will give you the last version (mine is V9.2.0) with NPM installed aswell.
Diogo JesusDiogo Jesus
I had same problem with debian then I tried this and problem solved.
Run this is command
curl -L https://npmjs.org/install.sh | sudo sh
check version
npm -v
You should see this after doing these steps
TAHA SULTAN TEMURITAHA SULTAN TEMURI
You got an old version of the package (append to me on debian 9)
if you try :
apt-cache show nodejs i think you will see the multiple version proposal.
just find the good repository name you want to use for your nodejs install :
Exemple for me it was :
And force the use of stretch repository during install :
since install is complete you got all the packages in the expected versions :
MayflyMayfly
If
nodejs -v shows version, it means nodejs is installed. you need to create soft link for node. Run below commands:
sudo ln -s /usr/bin/nodejs /usr/bin/node
And run
sudo apt-get install -y build-essential
Now check
node -v and npm -v . It will show version.
HOTAM SINGHHOTAM SINGH
Not the answer you're looking for? Browse other questions tagged node.jsnpmdebiandebian-stretch or ask your own question.
Node.js is a platform built on Chrome’s V8 JavaScript engine.Nodejs can used for easily building fast, scalable network applications. Latest version node.js ppa is maintaining by its official website. We can add this PPA to Debian 10 (Buster), Debian 9 (Stretch)Debian 8 (Jessie) and Debian 7 (Wheezy) systems. Use this tutorial to install latest Nodejs & NPM on Debian 10/9/8/7 systems.
To install specific nodejs version, Visit our tutorial Install Specific Nodejs Version with NVM.
Step 1 – Add Node.js PPA
You are required to add Node.js PPA to your system provided by the Nodejs official website. We also need to install the software-properties-common package if not installed already. You can choose either to install Latest Node.js version or LTS version.
For Latest Release
For LTS Release
Step 2 – Install Node.js on Debian
After adding required PPA file lets install Nodejs package. NPM will also be installed with node.js. This command will also install many other dependent packages on your system.
Step 3 – Cehck Node.js Version
After completeing the installation, check and verify the installed version of Node.js and NPM. You can find more details about current version on node.js official website.
Also, check the version of NPM.
Step 4 – Create Demo Web Server (Optional)
This is an optional step. If you want to test your node.js install. Let’s create a web server with “Hello World!” text. Create a file http_server.js
and add the following content
Now start the web server using the command.
Web server has been started on port 3000. Now access http://127.0.0.1:3000/ url in browser.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |