Как запустить Node.js на Mac после успешной установки его с помощью gem?

554
Alexander Farber

На Mac OSX Yosemite я успешно установил узел:

# sudo gem install node Fetching: eventmachine-1.0.7.gem (100%) Building native extensions. This could take a while... Successfully installed eventmachine-1.0.7 Fetching: node-0.0.2.gem (100%) Successfully installed node-0.0.2 Parsing documentation for eventmachine-1.0.7 unable to convert "\xCA" from ASCII-8BIT to UTF-8 for lib/fastfilereaderext.bundle, skipping unable to convert "\xCA" from ASCII-8BIT to UTF-8 for lib/rubyeventmachine.bundle, skipping Installing ri documentation for eventmachine-1.0.7 Parsing documentation for node-0.0.2 Installing ri documentation for node-0.0.2 2 gems installed 

И я вижу это в списке установленных драгоценных камней:

# gem list --local  *** LOCAL GEMS ***  activesupport (3.2.17) bigdecimal (1.2.0) CFPropertyList (2.2.8) claide (0.7.0, 0.5.0) cocoapods (0.35.0, 0.32.1) cocoapods-core (0.35.0, 0.32.1) cocoapods-downloader (0.8.1, 0.5.0) cocoapods-plugins (0.3.2) cocoapods-trunk (0.4.1) cocoapods-try (0.4.3, 0.2.0) colored (1.2) escape (0.0.4) eventmachine (1.0.7) fuzzy_match (2.0.4) i18n (0.7.0, 0.6.9) io-console (0.4.2) json (1.7.7) json_pure (1.8.1) libxml-ruby (2.6.0) minitest (5.5.1, 4.3.2) molinillo (0.1.2) multi_json (1.9.2) nap (0.8.0, 0.7.0) netrc (0.7.8) node (0.0.2) nokogiri (1.5.6) open4 (1.3.3) psych (2.0.0) rake (0.9.6) rdoc (4.0.0) sqlite3 (1.3.7) test-unit (2.0.0.0) thread_safe (0.3.4) tzinfo (1.2.2) xcodeproj (0.20.2, 0.16.1) 

Однако, когда я пытаюсь использовать его (тот же файл app.js отлично работает для меня в Windows 7) - интерпретатор Node.js не найден:

# node app.js -bash: node: command not found # sudo node app.js sudo: node: command not found 

Также нет файла узла в / usr / local / bin .

Посоветуйте, пожалуйста, как мне начать использовать установленный Node.js?

У меня такое ощущение, что здесь чуть-чуть не хватает.

0

1 ответ на вопрос

1
Eugene

This gem is a joke with all this hype with the node.js project.

It only includes the eventmachine gem and adds a new alias to it.

https://github.com/rafaelfranca/node

run

sudo apt-get update sudo apt-get install nodejs 

or

brew update brew install node