This is a creation in Article, where the information may have evolved or changed.
This article introduces the setting up of node. js, Golang and other environments under Ubuntu, and the difference between MAC installation is only two points:
The safest and newest way to install it is to find installation tutorial on the official website (or GitHub homepage). First, give me the official homepage I'm referring to during the installation process:
-
NVM (Node version manager) installation script:
curl-o-https://raw.githubusercontent /creationix/nvm/v0.31 .0 /install< Span class= "hljs-preprocessor" >.sh | Bash
Copy and paste into terminal, enter to begin installing NVM.
Install node. js
Enter the following command into terminal to view the latest version of node. JS:
ls-remote
Then select a version to install:
install v5.11.0
Where v5.11.0 is the node. JS version number and can be modified to another version. You can install node. js by entering the above into terminal carriage return. After the installation is complete, you can:
ls
View the version of node. js that you have installed.
Installation of Glup.js, Webpack, Bower, Vue.js
npm install -g gulp@latest webpack bower vue-cli
Note that NPM is not a nvm.
Installing Golang
Golang is the Go language development environment. The installation is divided into three steps: (1) Installing the Dependent Library, (2) installing Golang; (3) Configuring environment variables.
(1) Install dependent libraries
Copy the following code into terminal, enter:
sudo apt-get install bison ed gawk gcc libc6-dev make git mercurial
(2) Installation Golang
The simplest installation method is to enter the following script directly into the terminal carriage return:
sudo apt-get install golang
However, this installs the old version of Go. In order to install the new version, you can refer to the Golang official website installation instructions. The process is as follows:
(1) Download the latest Go Compress package from official website https://golang.org/dl/, download to local;
(2) Extract the compressed package to/usr/local/:
-C /usr/local-xzf go1.6.2.linux-amd64.tar.gz
(3) Add/usr/local/go/bin to the environment path. Opens the/etc/profile file,
sudo vim /etc/profile
and add the following code to the end of the profile file:
PATH=$PATH:/usr/local/go/bin
(4) Set the $GOPATH. The go language needs to set the default workspace, which is the GOPATH environment variable. Suppose the working directory is ~/gocode:
mkdir ~/gocode
Will:
export GOPATH=/home/USER/gocodeexport PATH=$PATH:$GOPATH/bin
Written into the end of the/etc/profile.
Installing Revel
Enter the installation code from the Revel GitHub home page to Terminal:
get -u github.com/revel/cmd/revel
Takes a long time. Because the network is not connected, this script will be executed at the end of the feedback two errors (Note: Although the error, but the above code will be executed, because the other code will be downloaded full):
packageimport"golang.org/x/net/websocket" (https fetch: Get https://golang.org/x/net/websocket?go-get=1: dial tcp [2404:6800:4005:803::2011]:443: getsockopt: host is down)packageimport"golang.org/x/sys/unix" (https fetch: Get https://golang.org/x/sys/unix?go-get=1: dial tcp [2404:6800:4005:803::2011]:443: getsockopt: host is down)
It's okay to find the net and SYS code from GitHub, clone to Local. After entering the gocode/src/directory, execute the following code:
mkdir golang.orgcd golang.orgxxgit clone https://github.com/golang/net.gitgit clone https://github.com/golang/sys.git
After the download is complete, enter:
install github.com/revel/cmd/revel
will give back soon. It's done. When you enter revel in terminal, the usage information appears, which means the installation is complete.