node-mongoskin: Got an error in 1.4.11 - "Cannot read property 'name' of undefined"

/home/zag2art/work/idg/node_modules/local-derby-server/node_modules/livedb-mongo/node_modules/mongoskin/lib/utils.js:33
  var skinClassName = 'Skin' + NativeClass.name;
                                          ^
TypeError: Cannot read property 'name' of undefined
  at makeSkinClass (/home/zag2art/work/idg/node_modules/local-derby-server/node_modules/livedb-mongo/node_modules/mongoskin/lib/utils.js:33:43)
  at Object.<anonymous> (/home/zag2art/work/idg/node_modules/local-derby-server/node_modules/livedb-mongo/node_modules/mongoskin/lib/admin.js:18:37)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (/home/zag2art/work/idg/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/zag2art/work/idg/node_modules/local-derby-server/node_modules/livedb-mongo/node_modules/mongoskin/lib/db.js:20:17)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (/home/zag2art/work/idg/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/zag2art/work/idg/node_modules/local-derby-server/node_modules/livedb-mongo/node_modules/mongoskin/lib/mongo_client.js:5:14)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (/home/zag2art/work/idg/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at /home/zag2art/work/idg/node_modules/local-derby-server/node_modules/livedb-mongo/node_modules/mongoskin/lib/index.js:25:15
  at Array.forEach (native)
  at Object.<anonymous> (/home/zag2art/work/idg/node_modules/local-derby-server/node_modules/livedb-mongo/node_modules/mongoskin/lib/index.js:24:80)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (/home/zag2art/work/idg/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/zag2art/work/idg/node_modules/local-derby-server/node_modules/livedb-mongo/node_modules/mongoskin/index.js:1:132)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (/home/zag2art/work/idg/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/zag2art/work/idg/node_modules/local-derby-server/node_modules/livedb-mongo/mongo.js:2:17)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (/home/zag2art/work/idg/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/zag2art/work/idg/node_modules/local-derby-server/server/store.js:10:17)
  at Object.<anonymous> (/home/zag2art/work/idg/node_modules/local-derby-server/server/store.js:114:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (/home/zag2art/work/idg/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at module.exports (/home/zag2art/work/idg/node_modules/local-derby-server/server/index.js:61:13)
  at Object.derbyServer.run (/home/zag2art/work/idg/node_modules/local-derby-server/index.js:64:33)
  at module.exports (/home/zag2art/work/idg/src/server/index.coffee:19:22)
  at Object.<anonymous> (/home/zag2art/work/idg/server.js:13:26)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:902:3

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 29 (3 by maintainers)

Commits related to this issue

Most upvoted comments

@iposton I changed the mongoskin version in my monk dependencies:

This is in my package.json inside node_modules/monk: “dependencies”: { “debug”: “*”, “mongoskin”: “^1.3.20”, “mpromise”: “0.5.1” }

Alternatively, just navigate to node_modules/monk in your shell, then do: npm uninstall mongoskin --save npm install mongoskin@1.3.20 --save

This will automatically change your mongoskin version and update the package.json.

This gets Monk to work. Monk requires Mongoskin and it seems that the latest push of Mongoskin is broken due to the NativeClass error here. So changing to 1.3.20 will tell npm to pull the previous working version of Mongoskin, which Monk can work with.

Hope that helps.

@kimeshan Thank you so much! Installing mongoskin version 1.3.20 helped me to solve this problem!!

1.4.13 uses "mongodb": "~1.4", see #159

The issue is because mongoskin installs newest mongodb driver

"peerDependencies": {
    "mongodb": ">= 1.4"
  },

And the newest released mongodb drive is "version": "2.0.24" which is not compatible with mongoskin anymore

So limiting dependency to

"peerDependencies": {
    "mongodb": "1.4.x"
  },

should fix the issue for now

@iposton I was having some problems with that too. I did the uninstall and then install, and that worked. Changing the package.json and then doing npm install didn’t play nice when I tried it.

So uninstall mongoskin when you’re inside node_modules/monk, then install by specifying the version with @.

npm uninstall mongoskin --save npm install mongoskin@1.3.20 --save