素材牛VIP会员
centos 运行express程序出现Cannot find module './binary_parser'
 阿***逗  分类:Node.js  人气:1039  回帖:2  发布于6年前 收藏

使用npm start 启动时报错
node版本v0.10.46
CentOS版本release 6.5 (Final)

代码依赖

"dependencies": {
    "body-parser": "~1.15.1",
    "cookie-parser": "~1.4.3",
    "debug": "~2.2.0",
    "ejs": "~2.4.1",
    "express": "~4.13.4",
    "morgan": "~1.7.0",
    "serve-favicon": "~2.3.0",
    "mongodb": "2.0.42",
    "express-session": "1.9.1",
    "connect-mongo": "0.8.2",
    "connect-flash": "0.1.1",
    "markdown": "0.5.0",
    "multer": "1.1.0",
    "async": "*",
    "express-handlebars": "*",
    "generic-pool": "*"
  }

> blog@0.0.0 start /root/blog
> node ./bin/www


module.js:340
    throw err;
          ^
Error: Cannot find module './binary_parser'
    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 exports.pure.classes (/root/blog/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/lib/bson/index.js:20:17)
    at Array.forEach (native)
    at Object.<anonymous> (/root/blog/node_modules/mongodb/node_modules/mongodb-core/node_modules/bson/lib/bson/index.js:19:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

npm ERR! Linux 2.6.32-431.1.2.0.1.el6.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v0.10.46
npm ERR! npm  v2.15.1
npm ERR! code ELIFECYCLE
npm ERR! blog@0.0.0 start: `node ./bin/www`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the blog@0.0.0 start script 'node ./bin/www'.
npm ERR! This is most likely a problem with the blog 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 information on how to open an issue for this project with:
npm ERR!     npm bugs blog
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls blog
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/blog/npm-debug.log

运行的程序代码地址
node.js 小博客

npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@2.15.1
3 info using node@v0.10.46
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart blog@0.0.0
6 info start blog@0.0.0
7 verbose unsafe-perm in lifecycle true
8 info blog@0.0.0 Failed to exec start script
9 verbose stack Error: blog@0.0.0 start: `node ./bin/www`
9 verbose stack Exit status 8
9 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
9 verbose stack     at EventEmitter.emit (events.js:98:17)
9 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:98:17)
9 verbose stack     at maybeClose (child_process.js:766:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:833:5)
10 verbose pkgid blog@0.0.0
11 verbose cwd /root/blog
12 error Linux 2.6.32-431.1.2.0.1.el6.x86_64
13 error argv "/usr/bin/node" "/usr/bin/npm" "start"
14 error node v0.10.46
15 error npm  v2.15.1
16 error code ELIFECYCLE
17 error blog@0.0.0 start: `node ./bin/www`
17 error Exit status 8
18 error Failed at the blog@0.0.0 start script 'node ./bin/www'.
18 error This is most likely a problem with the blog package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     node ./bin/www
18 error You can get information on how to open an issue for this project with:
18 error     npm bugs blog
18 error Or if that isn't available, you can get their info via:
18 error
18 error     npm owner ls blog
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

讨论这个帖子(2)垃圾回帖将一律封号处理……

Lv6 码匠
问***m Linux系统工程师 6年前#1

npm ERR! Please include the following file with any support request:
npm ERR! /root/blog/npm-debug.log

能否贴出这个日志文件的内容?


看来是缺模块,所以:

npm install binary-parser

Hope this helps.

Lv1 新人
陈***1 学生 6年前#2

npm install出现一个async的警告,原来是async版本太高
"async": "^1.4.0"

 文明上网,理性发言!   😉 阿里云幸运券,戳我领取