Can not find module / build / Debug / iconv.node

I'm trying to run the node.js server to a virtual machine Ubuntu.

I keep getting this error:

Error: Cannot find module '../build/Debug/iconv.node' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/vagrant/api/node_modules/geoipcity/node_modules/iconv/lib/iconv.js:27:14) 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 Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/vagrant/api/node_modules/geoipcity/geoipcity.js:35:13) 

Code around this line:

 /vagrant/api/node_modules/geoipcity/node_modules/iconv/lib/iconv.js:27:14 

It looks like:

 var bindings; try { bindings = require('../build/Release/iconv.node'); } catch (e) { bindings = require('../build/Debug/iconv.node'); } Release / iconv.node'); var bindings; try { bindings = require('../build/Release/iconv.node'); } catch (e) { bindings = require('../build/Debug/iconv.node'); } Debug / iconv.node'); var bindings; try { bindings = require('../build/Release/iconv.node'); } catch (e) { bindings = require('../build/Debug/iconv.node'); } 

The strange thing is that it exists, when I poked my directory structure:

 /vagrant/api/node_modules/geoipcity/node_modules/iconv/build/Release/iconv.node 

So, I'm not sure why this catch block to catch the catch. Actually, as I wrote this last sentence, I decided to try to register the detected error. It was:

 [Error: /vagrant/api/node_modules/geoipcity/node_modules/iconv/build/Release/iconv.node: invalid ELF header] 

Not sure if this is true, but I tried to run:

 node-gyp rebuild 

Using this result,

gyp info it worked if it ends with ok gyp info using node-gyp@0.13.0 gyp info using node@0.10.26 | linux | ia32 gyp info spawn python gyp info spawn args [ '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/vagrant/api/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/lib/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/home/vagrant/.node-gyp/0.10.26/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/home/vagrant/.node-gyp/0.10.26', gyp info spawn args '-Dmodule_root_dir=/vagrant/api', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' ] gyp: binding.gyp not found (cwd: /vagrant/api) while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp : 1 gyp ERR! ChildProcess.onCpExit(/usr/lib/node_modules/node-gyp/lib/configure.js:340:16) gyp ERR! ChildProcess.EventEmitter.emit(events.js: 98: 17) gyp ERR! Process.ChildProcess._handle.onexit(child_process.js: 797: 12) gyp ERR! System Linux 3.2.0-23-generic-pae gyp ERR! "node" "/usr/bin/node -gyp" "rebuild" gyp ERR! cwd/vagrant/api gyp ERR! node -v v0.10.26 gyp ERR! node -gyp -v v0.13.0 gyp ERR! >

Well, that's about all I have for now. Will continue to search for solutions and update here if I find something new.

Thanks in advance for your help. Oh, and please be careful - I Linux noob.

+6
source share
1 answer

Fixed, Change to the directory iconv and running:

 node-gyp configure node-gyp build 
+7
source

All Articles