# Node.js #### Installer l'extension Gestionnaire Node.js: ```bash # plesk ext nodejs --versions Enabled Version Path true 21.4.0 /opt/plesk/node/21/bin/node true 20.10.0 /opt/plesk/node/20/bin/node true 18.19.0 true 16.20.2 ``` ```bash root@localhost:~# /opt/plesk/node/20/bin/node -v v20.10.0 root@localhost:~# /opt/plesk/node/20/bin/npm -v 10.2.3 ``` ```bash bruno@localhost:~$ /opt/plesk/node/16/bin/node -v v16.13.2 ``` ```bash root@localhost:~# ln -s /opt/plesk/node/20/bin/node /usr/bin/node root@localhost:~# ln -s /opt/plesk/node/20/bin/npm /usr/bin/npm ``` #### Installer thumsup (en root): ```bash [sentier@localhost ~]$ sudo -i This server is powered by Plesk. Run the 'plesk login' command and log in by browsing either of the links received in the output. Use the 'plesk' command to manage the server. Run 'plesk help' for more info. root@localhost:~# ``` ```bash root@localhost:~# npm install -g thumbsup /opt/plesk/node/20/lib/node_modules/thumbsup' root@localhost:~# ln -s /opt/plesk/node/20/lib/node_modules/thumbsup/bin/thumbsup.js /usr/bin/thumbsup ``` Bug macOS Ventura ```bash /Users/bruno/.nvm/versions/node/v18.12.0/lib/node_modules/thumbsup/node_modules/macos-release/index.js ``` ```js 'use strict'; const os = require('os'); const nameMap = new Map([ [22, ['Ventura', '13']], [21, ['Monterey', '12']], [20, ['Big Sur', '11']], [19, ['Catalina', '10.15']], [18, ['Mojave', '10.14']], [17, ['High Sierra', '10.13']], [16, ['Sierra', '10.12']], [15, ['El Capitan', '10.11']], [14, ['Yosemite', '10.10']], [13, ['Mavericks', '10.9']], [12, ['Mountain Lion', '10.8']], [11, ['Lion', '10.7']], [10, ['Snow Leopard', '10.6']], [9, ['Leopard', '10.5']], [8, ['Tiger', '10.4']], [7, ['Panther', '10.3']], [6, ['Jaguar', '10.2']], [5, ['Puma', '10.1']] ]); const macosRelease = release => { release = Number((release || os.release()).split('.')[0]); const [name, version] = nameMap.get(release); return { name, version }; }; module.exports = macosRelease; // TODO: remove this in the next major version module.exports.default = macosRelease; ``` #### Installer les dépendances: ```bash # apt install libimage-exiftool-perl # apt install graphicsmagick ``` !!! warning "Après augmentation SSD 50Go -> 100Go, il faut réactiver node dans Plesk, et installer thumsup." !!! warning "Désactiver node sinon erreur 'phusionpassenger'"