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

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)

Related

Cannot find module , Missing modules #557

After npm install -g #vue/cli#3.0.0-beta.9 ,
I run the command vue create client
I get the following output:
module.js:557
throw err;
^
Error: Cannot find module 'cmd-shim'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous>
(/Users/atalante/.nvm/versions/node/v9.4.0/lib/node_modules/#vue/cli/lib/util/linkBin.js:10:27)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
i tried rm -rf node_modules and npm install
but it doesn't work.
This usually occurs when there is an issue with either your node or npm installations, Try updating node.js and npm to resolve the issue which has worked for me in the past. This might help in updating npm : Update NPM

Cannot find module 'xmlbuilder' when building ionic app

When i executing
ionic start myApp tabs
i am getting below error
Error: Cannot find module 'xmlbuilder'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:12:13)
at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:436:4)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
node -v gives v4.4.1
npm -v gives 2.14.20
i have done npm install xmlbuilder
Please install xmlbuilder module to global environment:
npm install -g xmlbuilder

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

Bower installs but gives error on every command

I've installed bower via npm npm install -g bower, i get no problems. But when i want to run bower, even just bower or bower -help i get the following error:
module.js:340
throw err;
^
Error: Cannot find module './parser'
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> (/usr/local/lib/node_modules/bower/node_modules/handlebars/lib/handlebars/compiler/base.js:1:80)
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)
cannot seem to find anyone else with this problem online.

Error: Cannot find module '../deps/console.log'

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.

Resources