Friday, May 17, 2019

Install Microsoft Visual Studio Code on a chromebook


My chromebook is fantastic! As it supports Linux integration feature, I can open a terminal and install every Debian based packages I want such as Microsoft Visual Studio Code. Let's go!


Step 1 - Import the Microsoft GPG key :
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

Step 2 - Add the Visual Studio Code repository :
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"

Step 3 - Install the latest version of Visual Studio Code
sudo apt update
sudo apt install code
That's all!


Install Node.js on a chromebook

If you have a chromebook which supports Linux experimental integration feature (look for this in your global parameters), then you can open a bash terminal. The Linux behind the scene seems to be Debian based.

So, to install Node.js, forget the classic way with sudo apt-get install nodejs because you will get an old release. Instead of that, you can to this :

Step 1 – Add Node.js PPA
sudo apt-get install curl software-properties-common
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
Step 2 – Install Node.js
sudo apt-get install nodejs
That's all!

(source : https://tecadmin.net/install-latest-nodejs-npm-on-debian/)



Sunday, May 12, 2019

Self upgrade of npm and node.js

Even I'm an old Java developer, I'm a newbie on node and npm and it's a new playground for me.

My project is to product some JS code (maybe TypeScript). As every software architect, my first question was : how to structure, package and deliver my project. This is done with npm (the package manager from node.js).

I've got npm on my laptop (installed with a classic sudo apt-get install npm) but I realized it's an old release.

Hopefully, node.js echosystem is great and everything can be self upgraded. Thus, you don't need any new debian package.  Great! Let's'do this :

# Let's upgrade node.js to the last stable release 
sudo npm cache clean -f
sudo npm install -g n
sudo n stable

# Then, we upgrade npm
sudo npm install npm@latest -g

# If your npm -v doesn't return the new version, you sould have multiple npm executable in your path
# On my Ubuntu, I changed the symbolic link
sudo ln -sf /usr/local/bin/npm /usr/bin/npm

That's all!

Install Microsoft Visual Studio Code on a chromebook

My chromebook is fantastic! As it supports Linux integration feature, I can open a terminal and install every Debian based packages I want ...