This page will help you prepare your computer for work with BioJS
You will need to work in a terminal using npm
and git
.
* Git is a version control system that will keep track of the changes you have made in code.
* Node.js is a ‘runtime environment platform for server-side JavaScript applications’.
Node’s package managing system is called npm.
Open your terminal of choice and check whether you have npm
, git
, and node
installed. You should run these without
any error.
git help
npm help
node help
If your machine is already set up, continue to the tutorial.
Otherwise, choose your operating system below to learn more:
If you want to fresh up your git
skills, check out the Git guide or 15 minutes interactive lesson by Codeschool.
What does npm
stand for?
Mac OSX
On Mac we recommend installing git and node.js via Homebrew. Homebrew is called the ‘missing package manager for OS X’. It allows you to download packages onto your Mac from your command line. Homebrew, git and node.js are packages worth having if you want to do software development on your Mac.
To get started, open a Terminal session first.
Then install Homebrew using this command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # brew is a package manager
Homebrew is quite a large package so downloading can take a while depending on your internet connection.
Then use Homebrew to install node.js:
brew install node
If you have not installed git
, this command uses homebrew to install git:
brew install git
Check if the installation was successful by typing “git help” and “npm help” into the command line again.
Alternatively you can also install node.js via the package installer and download Github for Mac.
Linux
Install nodejs via your package manager
E.g.
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - ; sudo apt-get install -y nodejs # Ubuntu, Debian
pacman -S nodejs # Arch
emerge nodejs # Gentoo
yum install npm # Fedora
If you want to avoid installing packages with sudo, you can use the node version manager nvm. Install it like this:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash # install nvm
Then set the most recent node version (or LTS in this case) as your default:
nvm install 4.2.2 && nvm alias default 4.2.2 && nvm use default # install node & npm in userenv
Now you can install node packages like this:
npm install drawrnajs
Windows
Windows is definitely not the preferred operating system for software development of this kind. So some additional and often unexpected effort will probably be necessary to get everything running. Be warned that some packages just assume that they have a UNIX-like environment. So consider using Linux or Mac OS if you have choice.
If you don’t have a choice or want to try anyway, installing git and npm on windows is still easy: Just download & install using the Windows installer for node and git.
After installation, you can use the Git Bash terminal for both npm and git commands in a UNIX-like environment.
Another possibility would be the Cygwin terminal emulator. This allows you to install git via a package manager. Please beware that node and npm don’t support Cygwin at the moment. However you can still use it through Cygwin after installing node via it’s installer or building an older version (< 4.2.2) from source.