在node.js中使用mongose模块
2015-11-25 01:22
597 查看
对象与文档相对应
创建项目目录,用root进入
# mkdir /home/test/part9/
直接# npm install mongoose,报错如下
../node_modules/nan/nan.h:316:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1
make: Leaving directory `/home/test/part9/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.10.0-229.14.1.el7.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/test/part9/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v0.10.6
然后安装node-gyp,
# npm install node-gyp -g
# npm install mongoose
错误消除了,有警告
/usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js
npm WARN unmet dependency /usr/lib/node_modules/block-stream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream-ignore requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream-npm requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/glob requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/npmconf requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/tar requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
创建项目目录,用root进入
# mkdir /home/test/part9/
直接# npm install mongoose,报错如下
../node_modules/nan/nan.h:316:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1
make: Leaving directory `/home/test/part9/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.10.0-229.14.1.el7.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/test/part9/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v0.10.6
然后安装node-gyp,
# npm install node-gyp -g
# npm install mongoose
错误消除了,有警告
/usr/bin/node-gyp -> /usr/lib/node_modules/node-gyp/bin/node-gyp.js
npm WARN unmet dependency /usr/lib/node_modules/block-stream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream-ignore requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/fstream-npm requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/glob requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/npmconf requires inherits@'~2.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/lib/node_modules/tar requires inherits@'2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
相关文章推荐
- [nodejs入门]第一篇,javascript基础(1)
- WRTnode自启动脚本程序
- nodejs取参四种方法req.body,req.params,req.param,req.body
- nodejs的express框架的response常用返回方式
- 怎样两个月完成Udacity Data Analyst Nanodegree
- 理解inode
- leetcode之Remove Nth Node From End of List
- nodejs
- Sublime Text3配置Node.js开发环境
- hadoop datanode 打不开
- hadoop2.6.2启动 发现DataNode没有启动启来
- Node.js(4) -- 七天学会node.js(2)
- node中的session和cookie备忘
- Node.js(3) -- 七天学会node.js
- node npm 安装时报错解决
- node笔记
- NodeJs概述
- 简单谈谈node.js 版本控制 nvm和 n
- 记一次hadoop datanode进程问题分析
- android编译分析之5—node_fns.mk