简体   繁体   English

mongoskin和猫鼬依赖性错误

[英]mongoskin and mongoose dependency error

I am new to full stack javascript and have been stuck on this error for a while now. 我是全栈javascript的新手,并且已经暂时停留在此错误上一段时间了。 At first, I saw this when running "npm-install": 起初,我在运行“npm-install”时看到了这个:

npm WARN EPEERINVALID mongoskin@1.4.13 requires a peer of mongodb@~1.4 but none was installed. npm WARN EPEERINVALID mongoskin@1.4.13需要mongodb @〜1.4的同行,但没有安装。

when I do nodemon server.js, I get the following error: 当我做nodemon server.js时,我收到以下错误:

/Users.../node_modules/agenda/node_modules/mongoskin/lib/utils.js:33 var skinClassName = 'Skin' + NativeClass.name; /Users.../node_modules/agenda/node_modules/mongoskin/lib/utils.js:33 var skinClassName ='Skin'+ NativeClass.name; ^ ^

TypeError: Cannot read property 'name' of undefined at makeSkinClass (/Users/....) TypeError:无法读取makeSkinClass(/ Users / ....)中未定义的属性“name”

I saw that this seems to be an issue for others also: https://github.com/kissjs/node-mongoskin/issues/153 我看到这对其他人来说似乎也是一个问题: https//github.com/kissjs/node-mongoskin/issues/153

but I'm really not sure how to proceed. 但我真的不知道该怎么办。 Which package.json file (and where) am I supposed to be editing, and for what reason? 我应该编辑哪个package.json文件(以及哪里),出于什么原因? I do not have "monk" in my npm_modules folder. 我的npm_modules文件夹中没有“monk”。

this fixed it! 这固定了! you have to npm install mongodb in the project directory and specify the version. 你必须在项目目录中安装mongodb并指定版本。

https://github.com/Automattic/monk/issues/91 https://github.com/Automattic/monk/issues/91

将此行添加到package.json,并在项目目录中再次运行'npm install'....它将重新安装/降级mongodb到版本1.4.4,'mongoskin'将完美安装...

    "mongodb": "^1.4.4",

I solved this issue by installing older versions of MongoDb. 我通过安装较旧版本的MongoDb解决了这个问题。 Follow these steps: 跟着这些步骤:

  1. npm uninsatll mongodb --save npm uninsatll mongodb --save

  2. npm install mongodb@1.4 --save npm install mongodb@1.4 --save

  3. npm install monk --save npm install monk --save

Hope this works!! 希望这个有效!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM