{"action":"created","issue":{"url":"https://api.github.com/repos/jaredallard/nexe/issues/219","repository_url":"https://api.github.com/repos/jaredallard/nexe","labels_url":"https://api.github.com/repos/jaredallard/nexe/issues/219/labels{/name}","comments_url":"https://api.github.com/repos/jaredallard/nexe/issues/219/comments","events_url":"https://api.github.com/repos/jaredallard/nexe/issues/219/events","html_url":"https://github.com/jaredallard/nexe/issues/219","id":154331016,"number":219,"title":"Error: No such native module ./charset.js","user":{"login":"just4give","id":9275193,"avatar_url":"https://avatars.githubusercontent.com/u/9275193?v=3","gravatar_id":"","url":"https://api.github.com/users/just4give","html_url":"https://github.com/just4give","followers_url":"https://api.github.com/users/just4give/followers","following_url":"https://api.github.com/users/just4give/following{/other_user}","gists_url":"https://api.github.com/users/just4give/gists{/gist_id}","starred_url":"https://api.github.com/users/just4give/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/just4give/subscriptions","organizations_url":"https://api.github.com/users/just4give/orgs","repos_url":"https://api.github.com/users/just4give/repos","events_url":"https://api.github.com/users/just4give/events{/privacy}","received_events_url":"https://api.github.com/users/just4give/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-05-11T20:06:25Z","updated_at":"2016-05-27T14:20:55Z","closed_at":null,"body":"I have read all the previous issue related to 'No such native module ..'  but could not resolve my problem. Hence posting it here for expert eyes.  It's a nodejs express application and I was able to create the exe successfully but when executing, getting this below error\r\n```\r\nnode.js:901\r\n      throw new Error(`No such native module ${id}`);\r\n      ^\r\n\r\nError: No such native module ./charset.js\r\n    at NativeModule.require (node.js:901:13)\r\n    at s (nexe.js:1:176)\r\n    at nexe.js:1:367\r\n    at nexe.js:158393:16\r\n    at Array.forEach (native)\r\n    at Object.__dirname.759 (nexe.js:158391:18)\r\n    at s (nexe.js:1:316)\r\n    at nexe.js:1:367\r\n    at Object.__dirname.3.mime-types (nexe.js:32:18)\r\n    at s (nexe.js:1:316)\r\n```\r\n\r\nHere is the nexe.js code (generated) \r\n```\r\nfunction Negotiator(request) {\r\n  if (!(this instanceof Negotiator)) return new Negotiator(request);\r\n  this.request = request;\r\n}\r\n\r\nvar set = { charset: 'accept-charset',\r\n            encoding: 'accept-encoding',\r\n            language: 'accept-language',\r\n            mediaType: 'accept' };\r\n\r\n\r\nfunction capitalize(string){\r\n  return string.charAt(0).toUpperCase() + string.slice(1);\r\n}\r\n\r\nObject.keys(set).forEach(function (k) {\r\n  var header = set[k],\r\n      method = require('./'+k+'.js'),\r\n      singular = k,\r\n      plural = k + 's';\r\n\r\n  Negotiator.prototype[plural] = function (available) {\r\n    return method(this.request.headers[header], available);\r\n  };\r\n\r\n  Negotiator.prototype[singular] = function(available) {\r\n    var set = this[plural](available);\r\n    if (set) return set[0];\r\n  };\r\n\r\n  // Keep preferred* methods for legacy compatibility\r\n  Negotiator.prototype['preferred'+capitalize(plural)] = Negotiator.prototype[plural];\r\n  Negotiator.prototype['preferred'+capitalize(singular)] = Negotiator.prototype[singular];\r\n})\r\n```\r\nLooking at the code, I noticed, code is trying to load some modules ( charset.js for example) from relative path ./charset.\r\nSo I placed charset.js ( from node_modules/negotiator/lib ) to root directory where .exe was created. But that did not solve the problem. Don't know what I am missing. Any help would be highly appreciated. \r\n"},"comment":{"url":"https://api.github.com/repos/jaredallard/nexe/issues/comments/222158944","html_url":"https://github.com/jaredallard/nexe/issues/219#issuecomment-222158944","issue_url":"https://api.github.com/repos/jaredallard/nexe/issues/219","id":222158944,"user":{"login":"palavrov","id":532427,"avatar_url":"https://avatars.githubusercontent.com/u/532427?v=3","gravatar_id":"","url":"https://api.github.com/users/palavrov","html_url":"https://github.com/palavrov","followers_url":"https://api.github.com/users/palavrov/followers","following_url":"https://api.github.com/users/palavrov/following{/other_user}","gists_url":"https://api.github.com/users/palavrov/gists{/gist_id}","starred_url":"https://api.github.com/users/palavrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palavrov/subscriptions","organizations_url":"https://api.github.com/users/palavrov/orgs","repos_url":"https://api.github.com/users/palavrov/repos","events_url":"https://api.github.com/users/palavrov/events{/privacy}","received_events_url":"https://api.github.com/users/palavrov/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T14:20:55Z","updated_at":"2016-05-27T14:20:55Z","body":"@yasserf, take in mind that in `npm-shrinkwrap.json` `socket.io` is a **fork** to the current master branch and can make you crazy if you try to update the module version in `package.json`. This is valid for `engine.io`, `accepts` and `negotiator` modules as well.\r\n\r\nI hope that related PR (socketio/engine.io#397 and socketio/socket.io#2567) will be merged soon so the final fix will be just to disable `serveClient`"}}
{"actor":{"display_login":"palavrov"}}