Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:nodejs [2017/12/25 20:25] alfred [Notes] |
wiki2:nodejs [2022/10/28 19:14] (actual) |
||
|---|---|---|---|
| Línea 56: | Línea 56: | ||
| # ln -s /usr/bin/nodejs /usr/bin/node | # ln -s /usr/bin/nodejs /usr/bin/node | ||
| </code> | </code> | ||
| + | |||
| + | |||
| + | ==== Best way to swap node versions ==== | ||
| + | |||
| + | The continuous exchange of NodeJS environments in your machine can bring some issues or be too uncomfortable. The best way to manage this is the ''nvm'' tool. | ||
| + | |||
| + | * https://github.com/nvm-sh/nvm | ||
| + | |||
| + | There you will find the installation procedure to follow. Once you have it, the use is as it follows: | ||
| + | |||
| + | <code> | ||
| + | $ nvm use 16 | ||
| + | Now using node v16.9.1 (npm v7.21.1) | ||
| + | $ node -v | ||
| + | v16.9.1 | ||
| + | $ nvm use 14 | ||
| + | Now using node v14.18.0 (npm v6.14.15) | ||
| + | $ node -v | ||
| + | v14.18.0 | ||
| + | $ nvm install 12 | ||
| + | Now using node v12.22.6 (npm v6.14.5) | ||
| + | $ node -v | ||
| + | v12.22.6 | ||
| + | </code> | ||
| + | |||
| + | * An alternative is [[https://asdf-vm.com/|asdf]]. | ||