Error: Cannot find module '../deps/console.log' - node.js

I'm on OS X 10.8.2, with Node.js 0.10.0 installed via homebrew. When I try to run npm test on nodegit, I get the following error:
cd test && nodeunit *.js
module.js:340
throw err;
^
Error: Cannot find module '../deps/console.log'
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> (/Users/faceleg/Work/Web/js-apprentice.com/Site/node_modules/nodegit/node_modules/.bin/nodeunit:11:1)
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)
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
I've done npm update && npm -g update since installing node 0.10.0.
How might I go about fixing this?

The stack trace says it all, it's an issue with nodeunit. I'd file an issue on their issues page.
Not knowing much about nodeunit, it looks like it's anticipating being run from a different location. It's trying to require the file /Users/faceleg/Work/Web/js-apprentice.com/Site/node_modules/nodegit/node_modules/deps/console.log.js which is (probably) actually located at /Users/faceleg/Work/Web/js-apprentice.com/Site/node_modules/nodegit/node_modules/nodeunit/deps/console.log.js.

Related

Node.js Error: Cannot find module 'libxml-xsd'

I am currently learning node and pulled a git project. When I am trying to run the main javascript file with the command node main.js, it is throwing the below error:
module.js:340
throw err;
^
Error: Cannot find module 'libxml-xsd'
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> (/Users/me/project/controller/product.js:12:11)
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> (/Users/me/project/main.js:44:15)
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)
I tried to run 'npm install libxml-xsd', but was not successful.
When I did npm list it says UNMET DEPENDENCY libxml-xsd#^0.2.0 and below is the stacktrace:
npm ERR! missing: libxml-xsd#^0.2.0, required by me#0.0.0
npm ERR! extraneous: libxmljs#0.15.0 /Users/me/project/node_modules/libxmljs
npm ERR! extraneous: libxmljs-easy#0.2.1 /Users/me/project/node_modules/libxmljs-easy
NOTE: I already ran npm install libxmljs, npm install libxmljs-easy and using Mac OS X 10.11. Node version - v0.10.36 and npm version - 2.14.7
EDIT: Using libxmljs directly also didn't fix the problem (as suggested by one user below)

npm version shows Error: Cannot find module 'readable-stream'

I have installed node js on my windows 7 machine, and the version is being shown as v4.1.2 but when I am trying to run npm install or even check npm version it throwing the following error. Can any one help me where is the problem?
C:\Users\nmadasu>npm version
module.js:338
throw err;
^
Error: Cannot find module 'readable-stream'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:\Users\nmadasu\AppData\Roaming\npm\node_modules\npm
\node_modules\are-we-there-yet\index.js:2:14)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
After reading SO (Node.js cannot find module 'readable-stream') solutions, I tried npm install gulp -g, even this also giving same error.
C:\Users\nmadasu>npm install gulp -g
module.js:338
throw err;
^
Error: Cannot find module 'readable-stream'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:\Users\nmadasu\AppData\Roaming\npm\node_modules\npm
\node_modules\are-we-there-yet\index.js:2:14)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
Try:
npm install -g readable-stream
After that:
npm install gulp -g
If you can't do
npm install gulp -g
because you always have : "Cannot find module 'readable-stream'"
then, do :
sudo apt-get install npm
For me on windows the unique process that works is deleting this folders
C:\Users\YOURUSER\AppData\Roaming\npm
C:\Users\YOURUSER\AppData\Roaming\npm-cache
and Reinstall nodejs downloaded from official website
I hopoe this help to others :D

Meteor bundle error on startup

I have an issue with meteor bundle. I try to start bundle with foreverjs but get error
root#ip-172-31-0-83:/home/ubuntu/bundle# cat ../logs/forever.log
module.js:340
throw err;
^
Error: Cannot find module 'fibers'
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/ubuntu/bundle/programs/server/boot.js:1:75)
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)
error: Forever detected script exited with code: 8
I tried install fibers via npm
npm install fibers -g
,also I've tried install in local meteor node_modules dir.
But unfortunately error stays.
Version of meteor is 0.9.1.1
The procedure to install Fibers has changed in 0.9.x+
From the docs:
cd bundle
cd programs/server
npm install
Also, the correct setup instructions (for a bundle built by any version of Meteor) can be found in the bundle's README file.

npm doesn't work on an ARM embedded device

I installed Node.js on an embedded device running with a core Linux 3.0.
When I try to execute npm to install some modules, I get the follow issue :
DM-37x# npm
module.js:340
throw err;
^
Error: Cannot find module 'npmlog'
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 /usr/local/bin/npm:18:11
at Object.<anonymous> (/usr/local/bin/npm:86:3)
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)
I already tried to reinstall node.js but the bug is still here.
How can I do to fix this problem?
Try installing (or reinstalling) npmlog.
See https://www.npmjs.org/package/npmlog
Make sure you have a package.json file in the top level of your project directory (each project).
Use npm ls
and
npm update
to make sure the npmlog package is included.

node.js returns "Cannot find module 'lockit-mongodb-adapter'"

I am going through my first node.js project. I've installed lockit , have a app.js file, and when I try to run it I get this error
module.js:340
throw err;
^ Error: Cannot find module 'lockit-mongodb-adapter'
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 new module.exports (C:\Users\xx\Documents\mailer\index.js:38:44)
at Object.<anonymous> (C:\Users\xx\Documents\mailer\examples\mongodb\app. js:32: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)
I am quite certain I have lockit-mongodb-adapter installed.
You need to install the module. Cd to the root of your app directory and run this command and make sure lockit-mongodb-adapter is in your node modules directory.
npm install lockit-mongodb-adapter
Another thing you can do if you are certain it is installed is double check to see what is installed by running this command:
npm list
And this one to see what is installed globally:
npm list -g
Update:
I was able to reproduce the issue you where having. And to resolve it I deleted the module from the node moules directory. And re-installed with the following command:
npm install lockit-mongodb-adapter -save
It now shows up in npm list with no issues:

Resources