Étiquette : mise-à-jour

[NPM] Mettre à jour Node et NPM sous Ubuntu (ligne de commande)

Complètement désinstaller nodejs et npm et tout réinstaller via nvm

Testé et validé! La méthode ci-dessous fonctionne à condition de bien supprimer à la main l’ensemble des fichiers et dossiers listés.

Source: Completely removing Node.js and Npm et la version PDF pour la postérité.

Removing Node.js

To recap, the best way (I’ve found) to completely uninstall node + npm is to do the following:

  • go to /usr/local/lib and delete any node and node_modules
  • go to /usr/local/include and delete any node and node_modules directory
  • if you installed with brew install node, then run brew uninstall node in your terminal
  • check your Home directory for any « local » or « lib » or « include » folders, and delete any « node » or « node_modules » from there
  • go to /usr/local/bin and delete any node executable

You may need to do the additional instructions as well:

  • remove: /usr/local/bin/npm
  • remove: /usr/local/share/man/man1/node.1
  • remove: /usr/local/lib/dtrace/node.d
  • execute: rm -rf /Users/[homedir]/.npm

Ré-installer nodejs avec nvm

Then download nvm and follow the instructions to install node. The latest versions of node come with npm, I believe, but you can also reinstall that as well

Attention: une fois nvm installé via le commande curl ou wget, taper la commande source ~/.profile dans le terminal pour rendre nvm accessible via la commande nvm (source: How to Install NVM (Node Version Manager) for Node.js on Ubuntu 12.04 LTS).

Node still isn’t uninstalled!

Dans mon cas, les deux premières manips décrites dans ce billet ont suffit. Si ce n’est pas votre cas, poursuivez avec les manips décrites ci-dessous.

If you have done the above and you can still execute node on your terminate by firing node then you might need to do the following. Download the source code from nodejs.org exactly like how you have installed your nodejs from source.

Inside the source code, instead of hitting ‘make’ and ‘make install’, do the following

This instruction will uninstall whatever the source has installed into your machine.

Node and Npm still not uninstalled

Well, if you did all the above and you can still use node on your machine. You might want to try using ‘locate’ and manually removing all the necessary npm and node files in your machine by using

after you remove anything from the above command, you should fire the following to update the latest locate database

but you will have the fire the above command every time you successfully remove certain directory as ‘locate’ only update periodically at a specific time every day.


Si la solution ci-dessus n’a pas fonctionné, vous pouvez toujours tenter les solutions ci-dessous:

Nouvelle solution

Passer en mode root en tapant sudo su. Puis taper la ligne suivante: curl -L https://www.npmjs.com/install.sh | sh.

Problème!

Attention: passer en mode root va updater NPM en mode root uniquement… Si l’on sort de ce mode (commande exit), la commande npm -v nous donne toujours la version précédente.

npm update check failed


Commencer par essayer ceci:

Source: How to Install Latest Node.js and NPM on Ubuntu with PPA. Version PDF pour la postérité: tecadmin.net-How to Install Latest Nodejs and NPM on Ubuntu with PPA.

[RBS Cooking] Mettre à jour les URLs Git de vos projets

Procédure à mettre en oeuvre pour RBS Cooking et le dossier /projects pour chaque projet Change en local.

Manipulations à n’effectuer qu’une seule fois pour tous vos projets

Changer l’origin de /rbscooking

Dans /home/intlangf/rbscooking :

(Vous trouverez cette URL dans le dossier netapsys.rbs-change/interne.projects sur https://gitlab.netapsys.fr/)

Changer l’origin de /projects

Dans home/intlangf/projects (le repository qui détient tous les settings de tous les projets – à ne faire qu’une fois, donc…) :

(Vous trouverez cette URL dans le dossier netapsys.rbs-change/interne.projects sur https://gitlab.netapsys.fr/)

Manipulations à répéter pour chacun de vos projets

Rebrancher votre repository local vers le nouveau repository distant (https://gitlab.netapsys.fr)

Dans le dossier local qui contient votre projet (exemple : /home/intlangf/change30/accastillage) :

Vérifier l’intégrité des URLs dans le change.xml de votre projet

Pour les modules versionnés sous GIT

Remplacer :

par le nouvel URL que vous trouverez dans le dossier netapsys/rbs-change/ sur le repository distant https://gitlab.netapsys.fr/ :

/!\ SUPPRIMER VOTRE LOGIN de l’URL :

Pour les modules versionnés sous SVN

Remplacer :

par le nouvel URL se présentant sous la forme https://svn.netapsys.fr/webedit4/wfrepo/modules//branches/ :

/!\ Pour l’ensemble des modules versionnés sous SVN, rajouter un attribut vcs= »svn »

  • ch compile-config
  • git status
  • git add change.xml
  • git commit -m « « 
  • git push origin master

Changer les settings par défaut du projet

Opération à effectuer obligatoirement

Ouvrir le fichier defaults.py relatif à votre projet dans un éditeur :

et remplacer :

par le nouvel URL du projet que vous trouverez sur le repository distant https://gitlab.netapsys.fr/ :

/!\ SUPPRIMER VOTRE LOGIN DE L’URL

Commiter les modifs :

  • git pull
  • git status
  • git add
  • git commit -m
  • git push

Opération facultative

L’opération suivante est facultative. Elle vous servira éventuellement pour d’anciens projets si votre mise en intégration/production bloque sur les modules concernés, mais c’est normalement dans le change.xml (voir https://wiki.netapsys.fr/grand-est/web/interne/rbscooking/start/update_git_urls#verifier_l_integrite_des_urls_dans_le_changexml_de_votre_projet) que ces informations doivent être consignées et seront prises en compte par cook.

Pour info :

  • la mise en intégration du projet Accastillage qui sert d’exemple dans cette doc est passée alors que j’ai supprimé les lignes ci-dessous du fichier defaults.py.
  • pour visualiser un sample des infos que doit contenir un fichier defaults.py, allez dans default/sample/settings/.

ATTENTION : les URLs dans les deux bouts de code ci-dessous ne sont pas forcément justes. Les vérifier depuis votre navigateur.

AVANT :

APRES :

Commiter les modifs :

  • git pull
  • git status
  • git add + fichier settings.py modifié
  • git commit -m
  • git push

Mise en intégration

Les URLs d’intégration de vos projets ont changé également.

Dans projects//settings ouvrir int.py.

Remplacer l’URL sous « hostname » : « «  par l’adresse IP du site en intégration.
(pour obtenir l’IP d’un site à partir de son URL, taper « dig « ).

Pour accastillage :