I setup Docker on MacOS yesterday, and wanted to run npm and getting: -bash: npm: command not found
What do I need to do to get it working okay? Thx.
I setup Docker on MacOS yesterday, and wanted to run npm and getting: -bash: npm: command not found
What do I need to do to get it working okay? Thx.
npm isn't installed on the image you're using.
You can do either of the following:
Install it via traditional means; dependent on the OS you're using.
Use an image, such as the official node image which will come with it pre-installed.
You could use #2 in a way such as:
docker run node npm -v
5.5.1 that printed out? That's from running npm -v. When you ran npm install random-ext you're running that on your local machine, not on Docker. If you want to drop into a shell on the Docker machine, run docker run -it node /bin/shnpm -v and then the container exits. If you run /bin/sh as the command (With the -it flags) then you will run /bin/sh which will run the shell interpreter - and now you can interact with the system, but when you finish (crtl+c, type exit, etc.) then again - the container exits. If you want to install commands, do so within the shell; or better yet - codify it into a Dockerfile and build a new image so you can re-use it.