markdown basic_install.md
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown basic_install.md相关的知识,希望对你有一定的参考价值。
# Basic setup for JS development environment
Open a new `Terminal` and type or use `Ctrl` + `Shift`+ `V` to paste following lines
## Only Ubuntu
```shell
sudo apt update
sudo apt-get install -y git zsh curl jq
```
### Mysql
[MySQL](https://www.mysql.com/) is an open-source database management system, commonly installed as part of the popular [LAMP](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04)(Linux, Apache, MySQL, PHP/Python/Perl) stack. It uses a relational database and SQL (Structured Query Language) to manage its data.
```shell
sudo apt install mysql-server
sudo mysql_secure_installation
```
## Only macOS
### X-code
```shell
xcode-select --install
```
### Homebrew
```shell
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
```
### Mysql
[MySQL](https://www.mysql.com/) is an open-source database management system, commonly installed as part of the popular [LAMP](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04)(Linux, Apache, MySQL, PHP/Python/Perl) stack. It uses a relational database and SQL (Structured Query Language) to manage its data.
download here https://dev.mysql.com/downloads/mysql/5.7.html#downloads
## Both Ubuntu & macOS
### Oh-my-zsh
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout...
```shell
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# it will ask for your session password
````
To make this change stick, restart your laptop :
```shell
sudo reboot
```
### Git
We will need to generate an ssh key pair to link your github account to your local machine
```shell
ssh-keygen -t rsa -b 4096 -C "your_github_email@example.com"
```
Press enter to leave the default configuration and do not enter a password when prompted
Next add key to ssh-agent
```shell
eval "$(ssh-agent -s)"
ssh-add -k ~/.ssh/id_rsa
```
Copy the content of your public key to the clipboard like this
```shell
pbcopy < ~/.ssh/id_rsa.pub
# Other whay
cat ~/.ssh/id_rsa.pub # and copy the content
```
Then connect to your Github account, got to *Settings* > *SSH and GPG keys* > *New SSH key*
Give a title and paste your public key in key field, then click on *Add ssh key*
After try
```shell
ssh -T git@github.com
It should be return
# Hi --------! You've successfully authenticated, but GitHub does not provide shell access
```
## Vscode
[Vscode](https://code.visualstudio.com/docs/setup/linux) is an open source text editor, thanks to its flexibility and plugins, it will be very useful for application development
download .deb package [here](https://go.microsoft.com/fwlink/?LinkID=760868) and type it to install
```shell
sudo apt install ./path/to_file.deb
```
In order to start vscode from the command line, open vscode and press `CTRL` + `SHIFT` + `P` in the dialog box that opens type `shell` and `ENTER` to install the configuration
Next go to plugin tab and install following plugins
Plugins
- ES7 React/Redux/GraphQL/React-Native snippets
- HTML Snippets
- Indent-rainbow
## Nvm
Nvm is Node Version Manager, It is thanks to him that we will be able to easily install and use several versions of Node.JS
```shell
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
```
Exit your shell and reopen a window, then type `nvm` and a command list should appear, if you have an error message like this `zsh: command not found: nvm`
open the `.zshrc` file like this` code ~/.zshrc` then add the following configuration at the end of the file
```text
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
```
Now you can install the latest node version this way:
`nvm install node` it will change automatically the default node version otherwise type `nvm use node` or `nvm use 11.0.1` for a given version.
now type `node -v` it will return `v 11.0.1`
## Mysql
[MySQL](https://www.mysql.com/) is an open-source database management system, commonly installed as part of the popular [LAMP](https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04)(Linux, Apache, MySQL, PHP/Python/Perl) stack. It uses a relational database and SQL (Structured Query Language) to manage its data.
You will then need to remove the root user by default otherwise you should use sudo to access mysql
connect to mysql with the identifiers you have just created
```shell
sudo mysql -u root -p
```
Then in mysql shell
```mysql
drop user 'root'@'localhost';
CREATE USER 'root'@'localhost' IDENTIFIED BY 'password_i_want';
GRANT ALL ON *.* TO 'root'@'localhost';
flush privileges;
exit
```
You can now you connect to mysql shell without sudo command
```shell
mysql -u root -p
```
以上是关于markdown basic_install.md的主要内容,如果未能解决你的问题,请参考以下文章