Monday, June 03, 2019

Building Visual Studio Code on the Jetson Nano

After fixing my firewall, I tried to install Visual Studio Code on the Jetson Nano.

Following
Quick build guide for visual studio code on the nano
didn't really work out that well, with errors running gyp.

Searching around, I found this post (Building Visual Studio Code on Jetson Nano) and managed to build and install Visual Studio Code by merging the commands from the two posts.

The series of commands used:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
curl -sL 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

sudo apt update
sudo apt install -y libx11-dev libxkbfile-dev libsecret-1-dev fakeroot npm curl nodejs nodejs-dev yarn

git clone https://github.com/Microsoft/vscode.git
pushd vscode
sed -i 's/4095/2048/g' package.json
scripts/npm.sh install
yarn
yarn run gulp vscode-linux-arm64-min
yarn run gulp vscode-linux-arm64-build-deb
sudo dpkg -i ./.build/linux/deb/arm64/deb/code-oss_1.??.?-*_arm64.deb

Then, to add the extensions manager, I followed this post.
Basically,
sudo nano /usr/share/code-oss/resources/app/product.json
and then, after
        "checksums": {
                "vs/workbench/workbench.main.js": "BompYN/DPDENjDaaz6Tl3w",
                "vs/workbench/workbench.main.css": "B0uvAV0QuNsAXdBJwcuhfA",
                "vs/code/electron-browser/workbench/workbench.html": "SJ2O65ioC$
                "vs/code/electron-browser/workbench/workbench.js": "+0ieKuns+AJ$
        }
add this:
,"extensionsGallery": {
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
    "itemUrl": "https://marketplace.visualstudio.com/items"
}
before the final bracket at the bottom.

Then reboot with:
sudo reboot

And after rebooting, run with:
code-oss

Hurray! 🎉🎊

No comments: