2014-11-05 1 views
1

나는 NVM을 사용하여 sudo을 사용하여 전 세계에 설치하지 않도록합니다. Bower, Grunt 등 모든 작업에 잘 작동합니다. 그러나 내가 할 때는 npm install -g express-generator 작동하지 않습니다. 전 세계적으로 정자를 설치할 때 예를 들어, heres는 내가 무엇을 얻을 :nvm과 함께 express-generator를 전 세계적으로 설치할 수 없습니다

npm install -g bower /Users/jrdillon522/.node/bin/bower -> /Users/jrdillon522/.node/lib/node_modules/bower/bin/bower [email protected] /Users/jrdillon522/.node/lib/node_modules/bower ├── [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])

잘 잘 작동? 내가 익스프레스 발전기를 설치할 때 나는 고전적인 오류가 발생합니다 :

npm ERR! Please try running this command again as root/Administrator.

그래서 내가 sudo npm install -g express-generator를 실행합니다. Heres는 그때 무엇을 얻을 :

sudo npm install -g express-generator Password: /Users/myName/.node/bin/express -> /Users/myName/.node/lib/node_modules/express-generator/bin/express [email protected] /Users/myName/.node/lib/node_modules/express-generator ├── [email protected] ([email protected]) └── [email protected] ([email protected]) ➜ ~ express -v zsh: command not found: express ➜ ~

왜?

답변

1

bin 경로 (/Users/myName/.node/lib/node_modules/express-generator/bin/express)가 사용자 환경에 추가되지 않은 것 같습니다. 당신이 당신의 .bashrc 파일을 수정하는 경우

는 예상대로 일이 작동하도록 파일의 맨 아래에 다음 줄을 추가 :

export PATH=$PATH:/Users/myName/.node/lib/node_modules/express-generator/bin 

그런 다음 설치를 다시 시도하십시오.

+1

그래서 나는 실제로 그것을'.zshrc' 파일에 추가해야만했지만 그래도 효과가있었습니다. 그게 정말 이상한데 아마도 뭔가 잘못되었다는 것을 의미합니다. 그러나 그것은 그것을 고쳤다. 감사! – JDillon522

+0

도와 드리겠습니다! <33 – rdegges

관련 문제