博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在node.js中使用mongose模块
阅读量:6816 次
发布时间:2019-06-26

本文共 2522 字,大约阅读时间需要 8 分钟。

对象与文档相对应

创建项目目录,用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

 

转载于:https://www.cnblogs.com/herosoft/p/4993462.html

你可能感兴趣的文章
用motion实现家庭视频监控
查看>>
帝国cms缩略图:网站不同地方生成不同的缩略图
查看>>
python Django Ajax基础
查看>>
aop point-cut表达式
查看>>
easyui的 getSelections 与 getSelected 对比区别
查看>>
后缀数组模板 UOJ#35. 后缀排序
查看>>
[转]DirectX Rendering Pipeline渲染管线图
查看>>
ImageMaigck不支持中文路径的问题
查看>>
俄罗斯方块
查看>>
ZOJ 2061 - Buy the Ticket
查看>>
27.将 VMware 服务器上的虚拟机备份到 Azure(上)
查看>>
【cocos2d-x从c++到js】22:使用非侵入方式扩展UI系统接口的举例
查看>>
Hibernate查询效率对比
查看>>
DROP TABLE 恢复【一】
查看>>
Message Flood(map)
查看>>
百度地图计算两坐标点之间距离计算
查看>>
getHibernateTemplate()
查看>>
【SPOJ】10628. Count on a tree(lca+主席树+dfs序)
查看>>
Uva10290 - {Sum+=i++} to Reach N
查看>>
本地域名解析
查看>>