devdropper87
devdropper87

Reputation: 4187

mongoskin and mongoose dependency error

I am new to full stack javascript and have been stuck on this error for a while now. At first, I saw this when running "npm-install":

npm WARN EPEERINVALID [email protected] requires a peer of mongodb@~1.4 but none was installed.

when I do nodemon server.js, I get the following error:

/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/....)

I saw that this seems to be an issue for others also: 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? I do not have "monk" in my npm_modules folder.

Upvotes: 6

Views: 5854

Answers (3)

Subham Gupta
Subham Gupta

Reputation: 341

I solved this issue by installing older versions of MongoDb. Follow these steps:

  1. npm uninsatll mongodb --save

  2. npm install [email protected] --save

  3. npm install monk --save

Hope this works!!

Upvotes: 0

Nay
Nay

Reputation: 727

Add this line to package.json, and run 'npm install' again in your project directory.... It will reinstall/downgrade mongodb to version 1.4.4, and 'mongoskin' will install perfectly...

    "mongodb": "^1.4.4",

Upvotes: 1

devdropper87
devdropper87

Reputation: 4187

this fixed it! you have to npm install mongodb in the project directory and specify the version.

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

Upvotes: 10

Related Questions