1er commit
De la docs au format Mkdocs
This commit is contained in:
67
docs/macos/node/ghost.md
Normal file
67
docs/macos/node/ghost.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# ghost
|
||||
|
||||
|
||||
|
||||
[Installer nvm](nvm.md).
|
||||
|
||||
Version LTS de Node:
|
||||
|
||||
```bash
|
||||
$ nvm install --lts
|
||||
$ nvm use --lts
|
||||
```
|
||||
|
||||
Installer ghost-cli:
|
||||
|
||||
```bash
|
||||
$ npm install -g ghost-cli
|
||||
```
|
||||
|
||||
Créer un répertoire où installer Ghost:
|
||||
|
||||
```bash
|
||||
$ mkdir myblog
|
||||
$ cd myblog
|
||||
$ ghost install local
|
||||
```
|
||||
|
||||
Quand l'installation est terminée, on accède à Ghost à l'adresse http://localhost:2368/ et http://localhost:2368/ghost/ pour la page administration.
|
||||
|
||||
|
||||
|
||||
Paramétrage de Ghost (après l'installation)
|
||||
|
||||
```bash
|
||||
$ ghost setup
|
||||
? Enter your blog URL: http://localhost:2368
|
||||
? Enter your MySQL hostname: localhost
|
||||
? Enter your MySQL username: root
|
||||
? Enter your MySQL password: [hidden]
|
||||
? Enter your Ghost database name: ghost_prod
|
||||
✔ Configuring Ghost
|
||||
✔ Setting up instance
|
||||
? Do you wish to set up "ghost" mysql user? Yes
|
||||
✔ Setting up "ghost" mysql user
|
||||
? Do you wish to set up Nginx? No
|
||||
ℹ Setting up Nginx [skipped]
|
||||
Task ssl depends on the 'nginx' stage, which was skipped.
|
||||
ℹ Setting up SSL [skipped]
|
||||
? Do you wish to set up Systemd? No
|
||||
ℹ Setting up Systemd [skipped]
|
||||
? Do you want to start Ghost? Yes
|
||||
Ghost is already running! Run `ghost ls` for more information
|
||||
```
|
||||
|
||||
|
||||
|
||||
View running ghost processes:
|
||||
|
||||
```bash
|
||||
$ ghost ls
|
||||
┌─────────────┬───────────────┬─────────┬───────────────────────┬────────────────────────┬──────┬─────────────────┐
|
||||
│ Name │ Location │ Version │ Status │ URL │ Port │ Process Manager │
|
||||
├─────────────┼───────────────┼─────────┼───────────────────────┼────────────────────────┼──────┼─────────────────┤
|
||||
│ ghost-local │ ~/Sites/ghost │ 2.0.3 │ running (development) │ http://localhost:2368/ │ 2368 │ local │
|
||||
└─────────────┴───────────────┴─────────┴───────────────────────┴────────────────────────┴──────┴─────────────────┘
|
||||
```
|
||||
|
||||
10
docs/macos/node/index.md
Normal file
10
docs/macos/node/index.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# WebServer
|
||||
|
||||
|
||||
|
||||
[Ghost](ghost.md)
|
||||
|
||||
[node-js](node-js.md)
|
||||
|
||||
[nvm](nvm.md)
|
||||
|
||||
163
docs/macos/node/node-js.md
Normal file
163
docs/macos/node/node-js.md
Normal file
@@ -0,0 +1,163 @@
|
||||
# node.js
|
||||
|
||||
|
||||
|
||||
[Node.js](https://nodejs.org/fr/)® est un environnement d’exécution JavaScript construit sur le [moteur JavaScript V8 de Chrome](https://developers.google.com/v8/).
|
||||
|
||||
[npm](https://www.npmjs.com) est un gestionnaire de paquets pour JavaScript automatiquement installé avec Node.
|
||||
|
||||
[nvm](https://github.com/creationix/nvm) (Node Version Manager) est un gestionnaire de version de Node.
|
||||
|
||||
|
||||
|
||||
### Installation (Homebrew):
|
||||
|
||||
```bash
|
||||
# installer node et npm
|
||||
|
||||
$ brew install node
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Installation (directe):
|
||||
|
||||
Installer [Node.js](https://nodejs.org/en/download/) (version LTS)
|
||||
|
||||
|
||||
|
||||
### Installation ([nvm](nvm.md)):
|
||||
|
||||
```bash
|
||||
$ brew install nvm
|
||||
|
||||
# installer Node 8
|
||||
$ nvm install 8
|
||||
|
||||
# installer Node 10
|
||||
$ nvm install 10
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Version de npm:
|
||||
|
||||
```bash
|
||||
# version:
|
||||
$ node -v
|
||||
v9.5.0
|
||||
$ npm -v
|
||||
5.6.0
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Update:
|
||||
|
||||
|
||||
```bash
|
||||
npm install npm@latest -g
|
||||
|
||||
$ brew install node
|
||||
|
||||
$ npm install npm --global
|
||||
```
|
||||
|
||||
https://docs.npmjs.com/getting-started/fixing-npm-permissions#option-2-change-npms-default-directory-to-another-directory
|
||||
|
||||
|
||||
|
||||
### Local:
|
||||
|
||||
Installer npm packages localement => `/Users/bruno/Sites/node_modules`
|
||||
|
||||
- Installer: `npm install <package_name>`
|
||||
- Mise-à-jour: `npm update` (depuis le répertoire du module)
|
||||
- Desinstaller: `npm uninstall <package_name>`
|
||||
|
||||
<u>Mises à jour disponibles:</u>
|
||||
|
||||
```bash
|
||||
bruno@silverbook:~/Sites/node_modules$ npm outdated
|
||||
Package Current Wanted Latest Location
|
||||
jquery MISSING 3.2.1 3.2.1
|
||||
livephotoskit 1.4.11 1.5.2 1.5.2
|
||||
```
|
||||
|
||||
<u>Mettre-à-jour:</u>
|
||||
```bash
|
||||
$ npm outdated | awk '{print $1}' | xargs npm update
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Global:
|
||||
|
||||
Installer npm packages globalement => `/usr/local/lib/node_modules/`
|
||||
|
||||
- Installer: `npm install -g <package_name>`
|
||||
- Mise-à-jour: `npm update -g <package_name>`
|
||||
- Désinstaller: `npm uninstall -g <package_name>`
|
||||
|
||||
|
||||
|
||||
|
||||
### Aller dans node_modules:
|
||||
|
||||
```bash
|
||||
bruno@SilverBook:~$ cd Sites/node_modules/
|
||||
```
|
||||
|
||||
puis
|
||||
|
||||
- Liste package installé: `nom ls`
|
||||
- Mises à jour disponibles: `nom outdated`
|
||||
- Installer une m-à-j: `nom update`
|
||||
- Installer un package: `nom install package`
|
||||
- Désinstaller un package: `nom uninstall package`
|
||||
|
||||
|
||||
|
||||
### Supprimer tous les modules:
|
||||
|
||||
```bash
|
||||
$ for package in `ls node_modules`; do npm uninstall $package; done;
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Maintenance:
|
||||
|
||||
```bash
|
||||
$ npm doctor
|
||||
npm WARN verifyCachedFiles Content garbage-collected: 46 (4358853 bytes)
|
||||
npm WARN verifyCachedFiles Cache issues have been fixed
|
||||
Check Value Recommendation
|
||||
npm ping OK
|
||||
npm -v v5.10.0 Use npm v6.4.1
|
||||
node -v v8.11.4
|
||||
npm config get registry https://registry.npmjs.org/
|
||||
which git /usr/bin/git
|
||||
Perms check on cached files ok
|
||||
Perms check on global node_modules ok
|
||||
Perms check on local node_modules ok
|
||||
Verify cache contents verified 2159 tarballs
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Packages:
|
||||
|
||||
[Rechercher un package](https://npms.io)
|
||||
|
||||
|
||||
|
||||
##### uninstall-all-modules
|
||||
|
||||
Desinstaller tous les modules=
|
||||
|
||||
```bash
|
||||
$ npm uninstall
|
||||
```
|
||||
|
||||
##### livephotoskit, jquery, picturefill
|
||||
109
docs/macos/node/nvm.md
Normal file
109
docs/macos/node/nvm.md
Normal file
@@ -0,0 +1,109 @@
|
||||
# nvm
|
||||
|
||||
|
||||
|
||||
Installer nvm:
|
||||
|
||||
```bash
|
||||
$ brew install nvm
|
||||
```
|
||||
|
||||
Créer un répertoire où sera installé les différentes versions de Node.
|
||||
|
||||
```bash
|
||||
$ mkdir ~/.nvm
|
||||
```
|
||||
|
||||
Editer .bash_profile pour régler le répertoire NVM_DIR
|
||||
|
||||
```bash
|
||||
$ nano ~/.bash_profile
|
||||
```
|
||||
|
||||
et ajouter les lignes suivantes.
|
||||
|
||||
```bash
|
||||
export NVM_DIR=~/.nvm
|
||||
source $(brew --prefix nvm)/nvm.sh
|
||||
```
|
||||
|
||||
Recharger le shell pour activer nvm.
|
||||
|
||||
```bash
|
||||
$ source ~/.bash_profile
|
||||
|
||||
$ echo $NVM_DIR
|
||||
$ nvm --version
|
||||
```
|
||||
|
||||
Installer NodeJS.
|
||||
|
||||
```bash
|
||||
# la dernière version 8
|
||||
$ nvm install 8
|
||||
|
||||
# la version 8.9.4
|
||||
$ nvm install 8.9.4
|
||||
|
||||
# la dernière version 6
|
||||
$ nvm install 6
|
||||
```
|
||||
|
||||
Liste des versions de Node installées:
|
||||
|
||||
```bash
|
||||
$ nvm ls
|
||||
# ou
|
||||
$nvm list
|
||||
-> v8.11.4
|
||||
v10.9.0
|
||||
default -> 8 (-> v8.11.4)
|
||||
node -> stable (-> v10.9.0) (default)
|
||||
stable -> 10.9 (-> v10.9.0) (default)
|
||||
iojs -> N/A (default)
|
||||
lts/* -> lts/carbon (-> v8.11.4)
|
||||
lts/argon -> v4.9.1 (-> N/A)
|
||||
lts/boron -> v6.14.4 (-> N/A)
|
||||
lts/carbon -> v8.11.4
|
||||
```
|
||||
|
||||
Versions téléchargées:
|
||||
|
||||
```bash
|
||||
$ cd $NVM_DIR
|
||||
- OR -
|
||||
$ cd ~/.nvm
|
||||
$ ls versions/node
|
||||
v10.9.0 v8.11.4
|
||||
```
|
||||
|
||||
Version en usage:
|
||||
|
||||
```bash
|
||||
$ node -v
|
||||
v8.11.4
|
||||
```
|
||||
|
||||
Changer de version:
|
||||
|
||||
```bash
|
||||
$ nvm use 10.9.0
|
||||
Now using node v10.9.0 (npm v6.2.0)
|
||||
$ nvm use 10
|
||||
Now using node v10.9.0 (npm v6.2.0)
|
||||
$ node -v
|
||||
v10.9.0
|
||||
```
|
||||
|
||||
```bash
|
||||
$ nvm use 8.11.4
|
||||
Now using node v8.11.4 (npm v5.6.0)
|
||||
$ node -v
|
||||
v8.11.4
|
||||
```
|
||||
|
||||
```bash
|
||||
$ nvm use --lts
|
||||
Now using node v8.11.4 (npm v5.6.0)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user