Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month at the Massachusetts Institute of Technology, in Building E51.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] node.js and npm on Debian?



Kent Borg <kentborg at borg.org> asks:
> But I can't figure out how to install npm. When I search for
> installation instructions they all seem to want me to pipe a curl
> command into a sudo bash. Huh? That's scary as hell.

Let others do the installation for you: my go-to technology for this is
Docker. First get docker installed
(https://docs.docker.com/install/linux/docker-ce/debian/). Then look for the
official containerized release of node here:
https://hub.docker.com/r/library/node/. Choose which versions of Node and
Debian that you want (look among the available tags); example 8.9.4 on
stretch. To run it, really all you need to type is this:

 docker run -d --name nodejs node:latest sleep 7d
 docker exec -it nodejs bash

You'll be at a shell prompt that includes Node.JS and npm. You can use the
"--volume" parameter to map a working directory into the container and to map
the modules you decide to install (/usr/local/lib/node_modules/npm), enabling
you to edit files on your host and work with them at the container's bash
prompt. Docker's drop-dead simple to learn, and it solves so many of these
installation headaches.

-rich





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org