How to install Node.js via binary archive on Linux?

1. Node.js Download

2. Unzip the binary archive to any directory you wanna install Node, I use /usr/local/lib/nodejs

$ NODE_VERSION=v10.15.0
$ NODE_DISTRO=linux-x64
$ sudo mkdir -p /usr/local/lib/nodejs
$ sudo tar -xJvf node-$NODE_VERSION-$NODE_DISTRO.tar.xz -C /usr/local/lib/nodejs 

3. Set the environment variable ~/.profile OR ~/.bash_profile , add below to the end

$ vi ~/.profile or
# or 
$ vi ~/.bash_profile

# .profile or .bash_profile add below to the end
# Nodejs
NODE_VERSION=v10.15.0
NODE_DISTRO=linux-x64
export PATH=/usr/local/lib/nodejs/node-$NODE_VERSION-$NODE_DISTRO/bin:$PATH

4. Refresh profile

$ source ~/.profile
# or
$ source ~/.bash_profile

5. Test installation using

$ node -v
$ npm version
$ npx -v

6. Change npm global path

# 1. Make a directory for global installations
$ mkdir ~/.npm-global


# 2. Configure npm to use the new directory path
$ npm config set prefix '~/.npm-global'


# 3. Open or create a ~/.profile file and add this line
$ vi ~/.profile 
or 
$ vi ~/.bash_profile


# 4. add below to the end
export PATH=~/.npm-global/bin:$PATH


# 5. Back on the command line, update your system variables
$ source ~/.profile
# or
$ source ~/.bash_profile

# 6. test
$ npm install -g jshint

https://github.com/nodejs/help/wiki/Installation

http://npm.github.io/installation-setup-docs/installing/a-note-on-permissions.html

ubuntu에서 mysql 5.7 또는 mariadb 10 이상 root password reset

# Stop MySQL
sudo service mysql stop

# Make MySQL service directory.
sudo mkdir /var/run/mysqld

# Give MySQL user permission to write to the service directory.
sudo chown mysql: /var/run/mysqld

# Start MySQL manually, without permission checks or networking.
sudo mysqld_safe --skip-grant-tables --skip-networking &

# Log in without a password.
mysql -uroot mysql

Update the password for the root user.

UPDATE mysql.user SET authentication_string=PASSWORD('YOURNEWPASSWORD'), plugin='mysql_native_password' WHERE User='root' AND Host='%';
EXIT;

mysql 재시작

# Turn off MySQL.
sudo mysqladmin -S /var/run/mysqld/mysqld.sock shutdown

# Start the MySQL service normally.
sudo service mysql start