Ionic-cli: Cannot load module Xmlbuilder

Created on 19 Feb 2016  路  10Comments  路  Source: ionic-team/ionic-cli

_From @karajrish on February 19, 2016 8:33_

Short description of the problem:

I have installed ionic on my Ubuntu 14.04 machine as per instructions from the official site. However, when I run the ionic command from my terminal for starting a new application it gives an error with the following stacktrace :

module.js:327
throw err;
^

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. (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:12:13)
at Object. (/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)

I have also tried installing xmlbuilder through the npm package installer but to no avail

Please help me in resolving this problem

_Copied from original issue: driftyco/ionic#5524_

Most helpful comment

Does uninstalling and reinstalling Ionic fix it?

Try npm cache clean, then npm install -g ionic (you may need sudo).

All 10 comments

Does uninstalling and reinstalling Ionic fix it?

Try npm cache clean, then npm install -g ionic (you may need sudo).

This is affecting me as well. Completely fresh install of Ubuntu 14.04. Reinstalling ionic doesn't help. Ive tried completely removing npm and nodejs and wiping both the cache and modules.

I've had the same issue, after trying every possible option, I stumbled upon this link https://blog.nraboy.com/2014/09/install-android-cordova-ionic-framework-ubuntu/ it seems to be working

Also getting this issue on redhat.
And have had this issue on ubuntu, I couldn't fix it reinstalled the OS and it worked. The original install was pretty fresh.

You should check your nodejs version.
command: nodejs -v
Make sure that nodejs is ver4, if other, you must uninstall your nodejs and install nodejs 4 again.
Goodluck!
P/s:
Uninstall:
sudo apt-get remove nodejs
Install:

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs

I got this error after trying this code:
$ npm install -g cordova ionic
Seems like npm needs to install ionic prior to cordova, so try this one afterwards.
$ npm install -g ionic cordova

I am with the same error and I made a lot of things to fix it

I'm having this problem too (running on Ubuntu 14.04).

I tried running cordova and it failed with a similar message. I suspect this is a problem with npm rather than ionic.

Hello all! Is this still an issue with the latest version of ionic? Thanks!

Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings