Node update version mac os

4 ways to update to the latest Node.js version on a Mac

Development is picking pace, and Node.js is shipping out a new version frequently. It is nice to have the latest version at hand in your development environment to test out new features.

There are a few ways to install Node.js. One of the obvious ones is to download the installer from nodejs.org. However, you might not want to be downloading a new installer every time there’s a new version out.

Here are few alternative ways to update to the latest version of Node.js on a Mac.

Nvm is a script-based node version manager. You can install it easily with a curl and bash one-liner as described in the documentation. It’s also available on Homebrew.

Assuming you have successfully installed nvm. The following will install the latest version of node.

The last option installs all global npm packages over to your new version. This way packages like mocha and node-inspector keep working.

N is an npm-based node version manager. You can install it by installing first some version of node and then running npm install -g n .

Assuming you have successfully installed n. The following will install the latest version of node.

Homebrew

Homebrew is one of the two popular package managers for Mac. Assuming you have previously installed node with brew install node . You can get up-to-date with formulae and upgrade to the latest Node.js version with the following.

MacPorts

MacPorts is the other package manager for Mac. The following will update the local ports tree to get access to updated versions. Then it will install the latest version of Node.js. This works even if you have a previous version of the package installed.

There also exists nodejs alternative to nodejs-devel that follows the long term support line.

Node doesn’t wait for your database call to finish?

Learn how asynchronous calls work and make your app run as you intended. Get short email course on asynchronicity and two chapters from Finish Your Node App.

Источник

How to Update Node.JS to Latest Version (Linux, Ubuntu, OSX, Windows, Others)

Node.js is very popular nowadays because of it’s feature like:

  • JavaScript runtime built on Chrome’s V8 JavaScript engine
  • Node.js uses an event-driven, non-blocking I/O model
  • Which makes it lightweight and efficient
  • Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Because of these features, Node.Js because very popular in no time and Now its developer’s favorite language for developing Rest APIs and Building high scaling apps.

So, Today in this How to Guide, we will be discussing all the methods for updating NodeJs to Latest version in Linux Os, Ubuntu Os, Windows 7, 8, 10 and Mac Osx using NVM (Node Version Manager) and NPM (Node Package Manager). And At last, we will discuss Best way to update Node.JS

How To Update Node.JS Using Node Version Manager (NVM)

Go to NVM’s official documentation and install the script using curl or wget method.

Читайте также:  Irbis tw36 как переустановить windows

Verify installation by using the following command,

Steps to update Node.JS using NVM:

When you’re working with multiple Node.Js utilities, sometimes you need some specific Node.js version installed, for this purpose nvm is the best option as we show the procedure below:

and, you can easily switch:

You can check what versions are currently installed with nvm ls and see what is available to install by using nvm ls-remote and you can even set default version using nvm alias default node

If you want to uninstall some version, use nvm uninstall 4.1.2

By NVM can be your Buddy if you’re troubleshooting your node.js app and you need to switch between versions.It has a lot of built-in utilities go and check it’s documentation fellas.

How To Update Node Using a Package Manager

  • First Check the version of installed npm using npm -v and then update it to latest version using npm install npm@latest -g
  • To update Node, you’ll need npm’s handy n module. Run this code to clear npm’s cache, install n, and install the latest stable version of Node:
  • sudo npm cache clean -f sudo npm install -g n sudo n stable
  • To install the latest released version, use n latest . Alternatively, you can run n #.#.# to get a specific Node version.

How to Update Node (Windows/macOS) Using Installers on Nodejs.org

  • Go to NodeJs Download page, download any release you want and install it using installer for your windows or macOs.
  • After installing you can verify, installation using
  • npm -v node -v
  • And,

You’re done, Now you have successfully installed Node.Js and NPM on your Windows or Mac Os uisng official installers.

Now, Coming to Best way to update Your Node.JS:

The best way is to use NVM, as it provides lot of built-in utilities, which are well documented and tested.

If you get any error during installation or update process, please leave the comment below and we will solve it for you.

Источник

Обновите Node.js до последней версии в Mac OS

В настоящее время я использую Node.js v0.6.16 на Mac OS X 10.7.4. Теперь я хочу обновить его до последней версии Node.js v0.8.1. Но после загрузки и установки последнего файла пакета с nodejs.org, я обнаружил, что система все еще использует v0.6.16 вместо v0.8.1, когда я набрал «node -v» в терминале. Есть ли какой-то шаг, который я пропустил? Или мне следует полностью удалить старую версию перед установкой последней?

Кстати, я знаю, что nvm может помочь в управлении пакетом nodejs

Есть ли способ обновить Node.js без его использования?

Я погуглил эту проблему, но мне кажется, что нет четкого ответа на этот вопрос для последней версии Node.js. Большое спасибо.

20 ответов

Вот как я успешно обновился с v0.8.18 до v0.10.20 без каких-либо других требований , таких как brew и т. д. (введите эти команды в терминале):

  1. sudo npm cache clean -f (принудительно) очистить кэш npm
  2. sudo npm install -g n установить «n» (это может занять некоторое время)
  3. sudo n stable обновить до последней версии

Обратите внимание, что sudo может запросить ваш пароль.

Если номер версии не отображается при вводе node -v , возможно, вам придется перезагрузиться.

эти инструкции также находятся здесь: davidwalsh.name/upgrade-nodejs

Если вы изначально установили Node.js с помощью Доморощенный , запустите:

Или как однострочник:

Примечание. Если у вас есть npm —version update (выше) на install

Удобный способ изменить версии — использовать nvm :

Чтобы установить последнюю версию Node.js с помощью nvm:

Если вы установили с помощью пакета, загрузите последнюю версию с nodejs. орг . См. Установка Node.js и обновление npm .

Поскольку это, по-видимому, на первом месте в Google при поиске способов обновления nodejs на Mac, я предложу свой совет всем, кто придет в будущем, несмотря на его возраст.

Читайте также:  Исчезли все точки восстановления windows

Обновление через NPM
Вы можете использовать метод, описанный @Mathias выше, или выбрать следующий более простой метод через терминал.

После чего вы можете подтвердить обновление

Ваши nodejs должны быть обновлены до последней версии. Если вы хотите перейти на конкретную версию, скажите v0.8.19, а не

ИЗМЕНИТЬ Избегайте использования sudo, если вам не нужно. См. Комментарий Стива в комментариях

Перейдите на http://nodejs.org и загрузите и запустите установщик. Это работает сейчас — по крайней мере для меня.

Вы можете установить nvm и установить несколько версий Node.js.

а затем запустите:

вы можете увидеть, с какими версиями вы установили:

и вы можете переключаться между версиями с помощью:

Преимуществом использования NVM является то, что вы можете тестировать разные версии вместе. Если для разных приложений требуются разные версии Node.js, вы можете запустить их оба.

Я использую менеджер версий Node (называемый n) для него.

Просто зайдите на сайт JS Website и установите последнюю версию.

Установите последнюю версию вместо рекомендуемой стабильной версии. Это даст вам свободу использовать новейшие функции ES6 на узле.

Можно найти здесь узел JS .

также для обновления npm вам придется использовать эту команду.

Все ваши проекты будут работать нормально.

Другая опция для mac :: brew update && brew install node && npm -g npm

В macOS рекомендуемый способ для доморощенного — запустить

Я могу обновить узел, используя следующую команду

к сожалению, n не работает для меня. Я использую node version manager or nvm , и это работает как шарм. вот ссылка на то, как установить nvm : https://github.com/creationix/nvm#installation

  • nvm i 8.11.2 обновить до последней LTS
  • nvm use 8.11.2 используйте его
  • node -v проверьте свою последнюю версию

Перейдите на веб-сайт nodejs.org и загрузите последнюю версию pkg, а затем установите. это работает для меня

Я использовал brew для обновления своего узла. Он установлен, но находится в /usr/local/Cellar/node/5.5.0 , а в /usr/local/bin/node что меня беспокоит. Я не хочу делать мягкую ссылку, потому что я действительно не знаю, как устроен варево. Поэтому я скачал файл pkg , и получил эту информацию:

Node.js был установлен в

npm был установлен в

Убедитесь, что /usr/local/bin в вашей переменной $ PATH.

Теперь обновление завершено

Вы можете просто зайти на nodejs.org и загрузить новейший пакет. Он будет обновляться соответствующим образом для вас. NPM также будет обновлен.

Вы можете запустить, но не можете спрятаться . В конце вы будете использовать NVM в любом случае.

Я думаю, что самый простой способ использовать новейшую версию Node.js — это получить новейший файл pkg Node.js на веб-сайте https://nodejs.org/en/download/current/ если вы хотите использовать другую версию Node.js, вы можете использовать nvm или n для управления ею.

Nvm Nvm — это менеджер версий узлов на основе сценариев. Вы можете легко установить его с помощью однострочного скручивания и загибания, как описано в документации. Это также доступно на Homebrew.

Если вы успешно установили nvm. Ниже будет установлена ​​последняя версия узла.

Последний вариант устанавливает все глобальные пакеты npm в вашу новую версию. Таким образом, такие пакеты, как mocha и node-inspector продолжают работать.

Н N — менеджер версий узлов на основе npm. Вы можете установить его, установив сначала некоторую версию узла, а затем запустив npm install -g n .

Если вы успешно установили n. Ниже будет установлена ​​последняя версия узла.

Homebrew Homebrew — один из двух популярных менеджеров пакетов для Mac. Предполагая, что вы ранее установили узел с узлом установки brew. Вы можете получить последние сведения о формулах и перейти на последнюю версию Node.js, выполнив следующие действия.

MacPorts MacPorts — еще один менеджер пакетов для Mac. Далее будет обновлено дерево локальных портов, чтобы получить доступ к обновленным версиям. Затем будет установлена ​​последняя версия Node.js. Это работает, даже если у вас установлена ​​предыдущая версия пакета.

Используйте nvm для обновления узла в соответствии с требованиями проекта.

Читайте также:  Что делать если нет установщик windows

установите nvm через homebrew .. заваривать обновление Brew установить NVM mkdir

В своем файле .bash_profile (возможно, вы используете другой файл, в зависимости от вашей оболочки), добавьте следующее:

Источник

How to Update Node Version In Mac In 2022

Right now, Node.js version 16.8.0 is the latest, and yours might be different depending on when you are reading this article. Web Development is changing rapidly. Development is picking at a rapid pace, and Node.js is shipping out the new version to almost everyone; therefore, it is nice to have the latest version at hand in your development environment to test out the new features and also made it compatible with other Javascript libraries.

Why you should upgrade the node

Well, you have many reasons that why you should update the node to the latest version because the Javascript community is getting bigger and bigger, and so does the NPM repository.

All the new JS frameworks and libraries require the latest node.js version because they are built on the latest technology, and to keep up with that. You also need to update all of your outdated libraries, especially Node.js.

Let me give you a scenario, and if you are using the current date’s latest version of React, which is React 16.2.0, and you have a node.js version of, let say 9.0, then you won’t be able to even install the React.js project due to some outdated libraries of node.js.

You do need to update to the latest version to even work with other JS libraries and frameworks.

Even node.js is improving from their previous version, so there are many reasons to upgrade your node.js to the latest version. Getting left behind will be the never option for yours.

How to Update Node Version on Mac

Okay, so we have seen why do we need to update Node.js, but the next question is how we are going to do it.

Well, three ways can do that job.

Update Node using N

It is the simplest way.

N is an npm-based node version manager.

I am assuming that you already have some version of node is installed on your machine.

You can install it by installing the first version of the node and then running the following command.

Assuming you have successfully installed n.

The following command will install the latest version of the node. Please hit that command in admin mode.

It will install the latest version of Node.js.

Update Node.js using Homebrew

Homebrew is one of the popular package managers for MacOS.

Assuming you have previously installed node with.

You can get up-to-date with formulae and upgrade to the latest Node.js version with the following command.

It will install the latest version of Node.js.

Update Node using NVM

Nvm is the script-based node version manager.

You can install it easily with the curl and bash one-liner as described in the documentation.

It’s also available on the Homebrew package manager.

You can install NVM using Homebrew using the following command.

Now the following command will install the latest version of the node.

The last option installs all the global npm packages over to your new version.

This way, the packages like mocha and node-inspector keep working.

Conclusions

Upgrading node to the latest version is kid’s stuff, but if you are running in trouble, you can always switch the way to update it.

If you are running in trouble using homebrew, please update the homebrew first and then install one by one missing dependency. It will work fine only after it has all the required dependencies.

Источник

Оцените статью