My goal was to find a lightweight laptop for communication, written content creation, and web development. The promise of installing Android Apps, access to Linux, and the fun of trying something new was too much to pass up on. I ended up with a Google Pixelbook; it’s gorgeous and it’s living up to the hype, albeit after some bumps and bruises. I wanted to share my experiences and hopefully you can avoid some of the tribulations I endured.

In this entry I go through setting up NodeJS for development on a Google Pixelbook. Be sure to check out the previous entries in my diary series—Pixelbook Diary #1: Getting Started and Pixelbook Diary#2: Setting Up Python

Installing Node via NVM

There are a variety of ways to install NodeJS on your Chromebook, but I’ve chosen to manually install Node Version Manager (NVM) then use NVM to install the latest stable release of NodeJS. It’s helpful to have the setup necessary to manage multiple versions of Node, similar to my advice when I set up Python earlier.

To get started, copy and paste the following into your Terminal window:

export NVM_DIR="$HOME/.nvm" && (
  git clone https://github.com/creationix/nvm.git "$NVM_DIR"
  cd "$NVM_DIR"
  git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh"

Once that’s done, we’ll open two files (~/.bashrc) and (~/.profile) using your text editor of choice and add the following to the bottom of each:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

At this point, NVM will load every time you open a Terminal window. To check, close and re-open Terminal then type command -v nvm to verify.

Now, you’re able to install a specific version of NodeJS. What I did was install the latest stable release using the following command:

nvm install stable

Once completed, we’ll check that the installation was successful by typing node --version 

Optional: Installing Yarn

Once you have NodeJS installed it comes with its own package manager—npm. If you’d like to use yarn, an alternative package manager developed by Facebook, follow below.

We’ll begin by retrieving the latest stable version of yarn with the command below:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Next, simply install the package using apt:

sudo apt install yarn

As with our NodeJS installation, we can verify yarn was successfully installed by typing yarn --version.

I hope this tutorial was helpful for you, I continue to love my Pixelbook and ChromeOS as a portable business machine.

Feel free to connect with me on Instagram, Twitter, or Medium.