2015-05-25 4 views
1

Я нахожусь на Йосемите, с установленным Homebrew, Node и NPM.Установка Yeoman на Yosemite

Homebrew 0.9.5 Узел v0.12.3 NPM 2.9.1

По какой-то причине, я не могу получить Yeoman правильно установить. Установить, кажется, не идет нормально, без ошибок, но когда я проверяю, чтобы подтвердить установку оно не дает мне --version, и я не могу выполнить функцию йа ...

Gregs-MacBook-Pro:~ G$ npm install -g yo 
/Users/G/npm/bin/yo -> /Users/G/npm/lib/node_modules/yo/lib/cli.js 

> [email protected] postinstall /Users/G/npm/lib/node_modules/yo 
> yodoctor 


Yeoman Doctor 
Running sanity checks on your system 

✔ Global configuration file is valid 
✔ No .bowerrc file in home directory 
✔ No .yo-rc.json file in home directory 
✔ NODE_PATH matches the npm root 

Everything looks all right! 
[email protected] /Users/G/npm/lib/node_modules/yo 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── cr[email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) 
Gregs-MacBook-Pro:~ G$ yo -v 
-bash: yo: command not found 

Я открыл. bashrc (нужно использовать sudo, чтобы открыть + сохранить его). Без sudo я не могу сохранить изменения.

sudo nano /.bashrc 

Файл Bashrc гласит:

# NPM packages in homedir 
NPM_PACKAGES="$HOME/.npm-packages" 

# Tell our environment about user-installed node tools 
PATH="$NPM_PACKAGES/bin:$PATH" 
# Unset manpath so we can inherit from /etc/manpath via the `manpath` command 
unset MANPATH # delete if you already modified MANPATH elsewhere in your configuration 
MANPATH="$NPM_PACKAGES/share/man:$(manpath)" 

# Tell Node about these packages 
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH" 

Я попытался установить узел через Homebrew первый и узнал об этой проблеме, которую я не мог решить либо. https://gist.github.com/DanHerbert/9520689

С тех пор я не сдул все в терминале, включая узел, npm и homebrew.

Теперь я застрял, NPM позволяет мне установить пакеты чернового-CLI, беседку и YEOMAN, но в любое время я пытаюсь вызовом этих пакетов я получаю:

-bash: yo: command not found 

Я предполагаю, что у него есть что-то . делать с содержимым /.bashrc, кто-нибудь помочь :(

+0

В 'OS x' вы должны поставить на экспорт в' ~/.bash_profile', затем закройте и перезапустите «Терминал». –

+0

Попытался добавить это в файл ~/.bash_profile и перезапустить. 'эхо экспорт PATH = \ "\ $ PATH \": ~/.node/бен >> ~/.bash_profile' не повезло:/ – gregbriandavis

+0

В терминале попробуйте команду' которая yo' или 'какой yeoman', что-нибудь появляется? –

ответ

0

у меня была такая же проблема при Yosemite

Мое решение было:

sudo find /usr/local/ -name yo 
/usr/local//Cellar/node/4.2.1/libexec/npm/bin/yo 

открытым $ HOME/.profile

export NODE_PATH="/usr/local/lib/node_modules" 

export PATH="/usr/local/Cellar/node/4.2.1/libexec/npm/bin:$PATH" 

export NODE_PATH=$NODE_PATH:/usr/local/Cellar/node/4.2.1/libexec/npm/lib/node_modules 

открыт новый терминал:

yo --version 
1.4.8 

, возможно, ваш вариант узла является проблемой. При начинающемся после установки 'заварить установки узла' У меня было слишком

node --version 
v0.12.7 

После

brew update 

и переустановить узел

node --version 
v4.2.1