Reputation: 779
I tried to install Ionic2 with no success, so I decided to go back to Ionic but during the process something went bad and I can't re-installl the ionic and cordova.
after sudo npm install -g cordova ionic
, I tried to run ionic
and got:
xx@xxx:~/dev$ ionic info
module.js:328
throw err;
^
Error: Cannot find module 'xmlbuilder'
at Function.Module._resolveFilename (module.js:326:15)
at Function.Module._load (module.js:277:25)
at Module.require (module.js:354: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:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
my versions are:
xx@xxx:~/dev$ npm -v
2.14.12
gal@xxx:~/dev$ nodejs -v
v0.10.25
xx@xxx:~/dev$ node -v
v4.2.6
Upvotes: 1
Views: 3258
Reputation: 686
Cleaning the npm cache helped in my case. The actions required were:
Install a stable version of nodejs depending of your OS follow these instructions.
Remove all installed versions of cordova and ionic:
sudo npm uninstall -g ionic cordova bower
Critically, clean the npm cache:
npm cache clean
Install from scratch:
sudo npm install bower cordova ionic -g
NOTE: Do not install nodejs version from Ubuntu 14.04 LTS repository because is outdated.
Upvotes: 1
Reputation: 51
You should check your version of nodejs. Make sure that it's version 4. If not, uninstall nodejs and install ver 4. 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
Upvotes: 0
Reputation: 21
I also encountered that issue. What I did was:
$ cd /usr/local/lib/node_modules/ionic/
$ npm install xmlbuilder
You may also use sudo
It just happens that xmlbuilder is a dependency of xml2js and cannot load the module because it wasn't included in the ionic's package.json of the upon installing ionic.
Upvotes: 2
Reputation: 480
What worked for me was to use
sudo npm install -g ionic@beta cordova
to install the V2 version according to link.
Upvotes: 1
Reputation: 4162
I faced similar issues while downloading ionic 2. Try to install node version 4.2.3 and cordova version 5.4.1 first and then install ionic
Upvotes: 0
Reputation: 1708
Have you tried to
sudo npm uninstall -g ionic
sudo npm install -g ionic
Upvotes: 0