2012-11-17 3 views
2

그래서 계속 보관할 필요가 없습니다. restarting node.js during developmentnode-dev을 사용하려고합니다. 나는 세계적으로 npm install node-dev -g 명령을 통해 노드 dev에 설치 한전 세계적으로 설치된 노드 -dev는 "명령을 찾을 수 없습니다."

$ node-dev server.js
-bash: node-dev: command not found

: 나는 터미널에서 노드-DEV를 실행하려고하면 불행하게도, 나는 오류가 발생합니다. 이 명령의 출력은 다음과 같습니다

npm http GET https://registry.npmjs.org/node-dev 
npm http 304 https://registry.npmjs.org/node-dev 
npm http GET https://registry.npmjs.org/growl 
npm http 304 https://registry.npmjs.org/growl 
/usr/local/share/npm/bin/node-dev -> /usr/local/share/npm/lib/node_modules/node-dev/node-dev 
[email protected] /usr/local/share/npm/lib/node_modules/node-dev 
└── [email protected] 

확실 노드 디바이스가 전 세계적으로 설치되어 반환 내가 npm ls -g를 실행했습니다 되려면 :

/usr/local/share/npm/lib 
└─┬ [email protected] 
    └── [email protected] 

일부 다른 게시물 표시 한 나의 전 세계적으로 설치 NPM 모듈해야 /usr/local/share/npm/lib/ 대신 /usr/local/lib/node_modules 폴더에 있어야합니다. 이것이 npm의 구버전이나 실제로 중요한 것인지 알 수 없습니다.

저는 Mac OS X 및 노드 개발에 익숙하지 않아서 사소한 것을 간과 한 것이 놀랍지 않습니다. node-dev를 활용하려고 할 때 "command not found"오류가 발생하는 원인은 무엇입니까? 내가 간과하고있는 $ PATH 환경 문제가 있습니까?

하나의 노트 나는 Growl을 설치하지 않았지만 node-dev 문서는 선택 사항임을 나타 냈습니다.

+0

태그 :'sublimetext2' :이 게시물에 매달려 죄송 D –

답변

1

문제가 될 수 있다고 생각합니다. 수정하려면 here's a walk-through입니다. 특히 WebStorm & 모카에 대한 것이지만 관련성이있는 것으로 보입니다. 별칭을 설정해야한다고 생각합니다.

env: node: No such file or directory

Reason for this is that when running GUI applications under MacOSX, the environment variables are not the same as those when you run a from a terminal. In particular, node for instance is not on the path. To overcome this issue, you can either launch WebStorm from the terminal (yuck!) or solve it. Fortunately this isn’t as hard as it once was. Here’s a Tip on our forum for RubyMine but it applies to all IDE’s including WebStorm. In essence, its creating an environment.plist file inside ~/.MacOSX which contains your full path. Mine is here if you want to download it. Make sure you reboot your machine after doing this step.

Setting up an alias

Everything should be working now, but instead of having to type this in each time, lets set up an alias for it in WebStorm. Click on Preferences (CMD+, under MacOSX) and type in Command to get to the command line tools. Click on the + button to create a new entry and confirm the dialog box to create a new custom framework.

enter image description here

+0

. 휴가가 내게 좋았고 모든 발전에서 멀어지게했다. 불행히도, 내 문제는 실제 노드 -dev 설치와 함께해야한다고 생각한다. 내 질문에 표시된대로 터미널에서 실행되도록 할 수 없습니다. 링크 된 게시물은 nodemon이 설치 후 바로 작동해야 함을 나타냅니다. 나는 node-dev가 같은 방식으로 작동한다고 생각할 것이고 실제로 post의 첫번째 부분을 시도한 후에 nodemon을 실행하려고 할 때 같은 오류가 발생했다. 이 때문에 필자는 npm 전역 설치에 관한 질문을 편집하고 다시 집중 시켰으며 터미널이 작동하면 숭고한 분위기로 되돌아 갈 것입니다. – ahsteele

관련 문제