2014-11-19 3 views
1

어젯밤 https://thinkster.io/angulartutorial/mean-stack-tutorial/의 평균 스택 자습서에서 작업 중이며 모든 것이 정상적으로 작동하고있었습니다. 그런 다음 오늘 아침에 다시 시작하려고하면 계속 npm 오류가 발생합니다. 그것은 localhost : 27017에 연결할 수 없다고하지만 지난밤에 포트 : 3000에 연결되어 있었고/bin/www 코드는 3000으로 설정되었습니다.노드 시작/끝내기 프로젝트 오류

아마도이 오류는 package.json 파일에있는 것 같습니다. " 시작 ":"노드 ./bin/www "하지만 도움이 필요하고 확실하지 않습니다. 감사.

Darraghs-MacBook-Pro:flapper-news dkdesign$ npm start 

> [email protected] start /Users/dkdesign/flapper-news 
> node ./bin/www 


events.js:72 
     throw er; // Unhandled 'error' event 
      ^
Error: failed to connect to [localhost:27017] 
    at null.<anonymous> (/Users/dkdesign/flapper-news/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:549:74) 
    at emit (events.js:106:17) 
    at null.<anonymous> (/Users/dkdesign/flapper-news/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15) 
    at emit (events.js:98:17) 
    at Socket.<anonymous> (/Users/dkdesign/flapper-news/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:533:10) 
    at Socket.emit (events.js:95:17) 
    at net.js:440:14 
    at process._tickCallback (node.js:419:13) 

npm ERR! [email protected] start: `node ./bin/www` 
npm ERR! Exit status 8 
npm ERR! 
npm ERR! Failed at the [email protected] start script. 
npm ERR! This is most likely a problem with the flapper-news package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node ./bin/www 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls flapper-news 
npm ERR! There is likely additional logging output above. 
npm ERR! System Darwin 14.0.0 
npm ERR! command "node" "/usr/local/bin/npm" "start" 
npm ERR! cwd /Users/dkdesign/flapper-news 
npm ERR! node -v v0.10.32 
npm ERR! npm -v 1.4.28 
npm ERR! code ELIFECYCLE 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /Users/dkdesign/flapper-news/npm-debug.log 
npm ERR! not ok code 0 

그리고 이것은 로그 파일이다 :

0 info it worked if it ends with ok 
1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose run-script [ 'prestart', 'start', 'poststart' ] 
5 info prestart [email protected] 
6 info start [email protected] 
7 verbose unsafe-perm in lifecycle true 
8 info [email protected] Failed to exec start script 
9 error [email protected] start: `node ./bin/www` 
9 error Exit status 8 
10 error Failed at the [email protected] start script. 
10 error This is most likely a problem with the flapper-news package, 
10 error not with npm itself. 
10 error Tell the author that this fails on your system: 
10 error  node ./bin/www 
10 error You can get their info via: 
10 error  npm owner ls flapper-news 
10 error There is likely additional logging output above. 
11 error System Darwin 14.0.0 
12 error command "node" "/usr/local/bin/npm" "start" 
13 error cwd /Users/dkdesign/flapper-news 
14 error node -v v0.10.32 
15 error npm -v 1.4.28 
16 error code ELIFECYCLE 
17 verbose exit [ 1, true ] 

답변

1

27017는 MongoDB를의 기본 포트입니다. 응용 프로그램을 실행하기 전에 mongodb 서버를 시작했는지 확인하십시오.

+0

은, 대단히 감사합니다. –

+0

답을 해결 된 것으로 표시하십시오. –

0

시도 실행 :이 일 경우

killall -9 node 

확인하려면 다음을이었다

ps aux