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:24] alfred [Packages.json] |
wiki2:nodejs [2022/10/28 19:14] (actual) |
||
|---|---|---|---|
| Línea 52: | Línea 52: | ||
| ===== Notes ===== | ===== Notes ===== | ||
| + | Si lo instalas en Ubuntu el comando será ''nodejs'', para que use el global (''node'') haz: | ||
| + | <code> | ||
| + | # ln -s /usr/bin/nodejs /usr/bin/node | ||
| + | </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]]. | ||