제목은 대부분의 문제를 말합니다. node .
을 실행하려고하면 다음과 같이 표시됩니다.노드. 그리고 npm 시작은 작동하지 않습니다
module.js:340
throw err;
^
Error: Cannot find module 'static-favicon'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
모듈 폴더가 실제로없는 것 같습니다. 그냥 빈 디렉토리에 express
을 실행 중입니다.
npm이 제대로 작동합니다. 새로운 익스프레스 설치가 중요하다. 어떤 도움도 굉장 할 것입니다, 감사합니다!
전체 오류 메시지 :
new-host-2:~ Brennan$ cd Desktop/
new-host-2:Desktop Brennan$ mkdir test4
new-host-2:Desktop Brennan$ cd test4
new-host-2:test4 Brennan$ express -e
create : .
create : ./package.json
create : ./app.js
create : ./public
create : ./public/javascripts
create : ./public/images
create : ./public/stylesheets
create : ./public/stylesheets/style.css
create : ./routes
create : ./routes/index.js
create : ./routes/users.js
create : ./views
create : ./views/index.ejs
create : ./views/error.ejs
create : ./bin
create : ./bin/www
install dependencies:
$ cd . && npm install
run the app:
$ DEBUG=test4 ./bin/www
new-host-2:test4 Brennan$ node app.js
module.js:340
throw err;
^
Error: Cannot find module 'static-favicon'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/Brennan/Desktop/test4/app.js:3:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
new-host-2:test4 Brennan$ npm start app.js
npm ERR! Error: ENOENT, open '/Users/Brennan/Desktop/test4/node_modules/app.js/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 12.4.0
npm ERR! command "node" "/usr/local/bin/npm" "start" "app.js"
npm ERR! cwd /Users/Brennan/Desktop/test4
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.7
npm ERR! path /Users/Brennan/Desktop/test4/node_modules/app.js/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Brennan/Desktop/test4/npm-debug.log
npm ERR! not ok code 0
new-host-2:test4 Brennan$ forever app.js
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
module.js:340
throw err;
^
Error: Cannot find module 'static-favicon'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/Brennan/Desktop/test4/app.js:3:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
error: Forever detected script exited with code: 8
'node app'을 실행하십시오. – Michael
랜덤'노드 앱'과 같은 오류가 발생했습니다. 사실 그것은 '오류 : 모듈을 찾을 수 없습니다'정적 - favicon'' 오류입니다. – Bren
어떤 익스프레스 버전을 사용하고 있습니까? – Michael