Skip to content

Instantly share code, notes, and snippets.

@alexbosworth
Last active Sep 7, 2021
Embed
What would you like to do?
Setup NPM

Install make

You will probably need build essential tools

# Ubuntu install build tools:
sudo apt-get install -y build-essential

Install Node.js

Node installation instructions

The instructions for Ubuntu/Debian:

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

Setup NPM

Avoid having to use sudo with npm on Ubuntu:

# Make a local directory for NPM
mkdir ~/.npm-global

# Configure NPM to use npm-global for non-root access
npm config set prefix '~/.npm-global'

# Add .npm-global/bin to $PATH
# Change ~/.profile to ~/.zshrc if you are running in zsh shell like on macos
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.profile

# Update the local $PATH (don't forget the leading . with a space after it)
. ~/.profile
@Jestopher-BTC

This comment has been minimized.

Copy link

@Jestopher-BTC Jestopher-BTC commented Apr 27, 2020

For the PATH line under emacs, clarify that the line should be added to the file, not as a replacement for any other existing PATH definitions that may be present on a raspiblitz.

@openoms

This comment has been minimized.

Copy link

@openoms openoms commented Apr 27, 2020

See the steps for the RaspiBlitz:
https://gist.github.com/openoms/823f99d1ab6e1d53285e489f7ba38602

Will work on adding it to the SERVICES.

@HTransistor

This comment has been minimized.

Copy link

@HTransistor HTransistor commented Jun 14, 2020

tried that on tmux, closed session, opened new terminal bos: command not found. need to do . ~/-profile again.

@alexbosworth

This comment has been minimized.

Copy link
Owner Author

@alexbosworth alexbosworth commented Jun 14, 2020

tried that on tmux, closed session, opened new terminal bos: command not found. need to do . ~/-profile again.

Maybe it needs to be in .bashrc or .bash_profile or something

@HTransistor

This comment has been minimized.

Copy link

@HTransistor HTransistor commented Jun 15, 2020

One of those should work:

  1. echo "source ~/.profile" >> ~/.bash_profile
  2. echo "source ~/.profile" >> ~/.bashrc

Then restart console. Now it should work everytime you open console.
Would be nice, if you could add this to the README.md.

@Kixunil

This comment has been minimized.

Copy link

@Kixunil Kixunil commented Mar 26, 2021

Please do not recommend users to use https://deb.nodesource.com/setup_12.x. It can break the system, as happened to a friend, and is generally less secure than installation from Debian/Ubuntu packages.

Simple apt install nodejs is enough. The version in Debian stable is supported by bos, so there's no problem. Users with older system should just upgrade the OS instead of making "franken Debian".

Ubuntu generally has newer packages than Debian stable, so the same applies in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment