Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 897
devdropper87 Avatar asked Oct 16 '15 00:10

devdropper87


2 Answers

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

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

like image 85
devdropper87 Avatar answered Oct 20 '22 22:10

devdropper87


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",
like image 33
Nay Avatar answered Oct 21 '22 00:10

Nay