Well, it stinks, here's the scoop:
I help a friend work on a website project using the MEAN stack (mongodb, express, angular and nodejs), I am running Ubuntu 14.04. I'm pretty good at Linux, and I'm an experienced web developer, but most of my experience is with the LAMP stack. I have so far fine-tuned this MEAN project until this evening. My friend started developing again this evening, and I helped them upgrade their node env on Mac (they basically do HTML / CSS with an interface, and I do a full stack) by running an npm update, and the project works fine on their comp. Assuming that I could just as easily update the node environment to be more accurate, I tried the same thing:
I tried to update the node and npm environment, because several months have passed since I did this (I know that this is bad, I messed up, I admit), I think I used Node. js v 0.3.2.something, did not think to check version numbers before this chaos ensued. But now I get crazy sets of random errors, unsatisfied dependencies, I cannot resolve unsatisfied dependencies using npm install to extract them, and I cannot fall asleep to start the dev server, I tried to remove node and npm and reinstall (nodejs are now running 0.10.25), launched apt-get update, apt-get install nodejs, apt-get install nodejs-dev, npm update, npm installation, etc., but to no avail.
I'm not stuck or disappointed, please help! Here is a selection of some errors / missing dependencies that I get:
module.js:340 throw err; ^ Error: Cannot find module './helpers' 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> 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) npm ERR! weird error 8 npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian npm ERR! not ok code 0
and when I try to run sudo grunt, I get the following:
Loading "jshint.js" tasks...ERROR >> Error: Cannot find module './name-stack.js' Loading "grunt-karma.js" tasks...ERROR >> Error: Cannot find module 'depd' Warning: Task "jshint" not found. Used --force, continuing. Running "concurrent:default" (concurrent) task Loading "jshint.js" tasks...ERROR >> Error: Cannot find module './name-stack.js' Loading "jshint.js" tasks...ERROR >> Error: Cannot find module './name-stack.js' Loading "grunt-karma.js" tasks...ERROR Loading "grunt-karma.js" tasks...ERROR >> Error: Cannot find module 'depd' >> Error: Cannot find module 'depd' [Error: /home/user/Projects/detrashed/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build/Release/bson.node: invalid ELF header] js-bson: Failed to load c++ bson extension, using pure JS version [Error: /home/user/Projects/detrashed/node_modules/connect- mongo/node_modules/mongodb/node_modules/bson/build/Release/bson.node: invalid ELF header] js-bson: Failed to load c++ bson extension, using pure JS version module.js:340 throw err; ^ Error: Cannot find module './collection/batch/unordered' 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> (/home/user/Projects/detrashed/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/collection.js:21:17) 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)
How embarrassing. Any help or insight on how to tune * ck my nodejs environment would be extremely helpful because I am going to pull my hair out. Thanks in advance!