[root tip] [How To] Avoid common pitfalls as developer

Spend your time coding

As a long time developer - using Arch and Manjaro - I can tell from experience - having your workflow broken is extremely stressing - especially due to system issues.

Issues you can avoid and I will share with you - how to avoid them.

Spend your time coding instead of fixing system issues.

Development tools

Users new to Manjaro and development is often trapped with unnecessary problems and issues, due to how Manjaro and Arch package management works.

When using Python, NodeJS and JetBrains tools using a simple set rules and you will avoid issues which otherwise would have cost you hours to fix.

Python

Always install system wide packages using pacman

sudo pacman -Syu python-pkgname

NEVER use sudo pip

This is likely to create maintenance Failed to commit transaction issues at a later stage so avoid

sudo pip install pkgname

If you need PyPi package use the --user argument

pip install --user pkgname

Use a virtual environment if you have complex scenarios

Install a virtual environment using pacman - one example is python-virtualenvwrapper

sudo pacman -Syu python-virtualenvwrapper

Then source the wrapper script in your .bashrc or .zshrc or on the commandline

source /usr/bin/virtualenvwrapper.sh

Use commands like

mkvirtualenv my-project

Cd to your project folder and run your scripts - install the python packages needed etc.

To set your python environment for my-project

workon my-project
pip install numpy

When you are done

deactivate my-project

Node JS

Nodejs is often installed as dependency for other packages e.g. Electron based apps.

Never mess with the system nodejs.

Never install node packages using sudo

This also likely to create maintenance Failed to commit transaction issues at a later stage so avoid

sudo npm install -g gulp
sudo npm install http

Use a node version manager

One option is to use pnpm (GitHub - pnpm/pnpm: Fast, disk space efficient package manager -- 快速的,节省磁盘空间的包管理工具) which is packaged for Manjaro by @Yochanan

Another option is NVM a node version manager - which runs node in your home folder - and you can install and run different versions of nodejs - something that is impossible using the package manager - where you will always be forced to use a specific version

nvm.sh project on Github

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash

Install a node interpreter - you can install several if necessary and switch between them

nvm install node

Then install node packages - even global packages - using commands like this

npm install -g gulp
npm install http

JetBrains tools

You can install JetBrains tools from AUR - but they are installed into /opt and thus requires superuser when the tool informs you that updates are available.

It is better using the Jetbrains Toolbox App to install the tools.

If you are using a single app e.g. PyCharm, PhpStorm or WebStorm and you don’t want or need the Toolbox

  • download the archive
  • unpack it in your home.
  • navigate into the unpacked folder
  • run the app’s launcher script from the bin folder.

Android Studio

Android Studio is based on IntelliJ - the core of all JetBrains tools - install it using the Toolbox App or download from android.com

  • download the archive
  • unpack it in your home.
  • navigate into the unpacked folder
  • run the app’s launcher script from the bin folder.

dotnet core SDK

The packages in the repo is mostly runtime packages.

As developer you want all binaries provided by the current dotnet core LTS and there is only one viable method to achieve this on one step using an Arch based distribution.

This is a custom package - jump to the custom dotnet package article to learn how.

To educate yourself on use of AUR and why it is unsupported please jump to article About Manjaro and AUR

Conclusion

Have fun developing and educating yourself in the fantastic and endless world of coding.

9 Likes