Impossible to get Ionic running


#1

It’s been several times that I’m trying to even create an Ionic project, but with no success.

I’m on Elementary OS Freya and I:

  • Installed Node.js with 3 different methods, trying all the versions. I tried with the version in the repositories (the legacy and the non-legacy one) then I tried following these instructions https://nodejs.org/en/download/package-manager/, then I tried downloading the tarball from the Node.js homepage and copying the files in my system. Both with version 4.x and 5.x
  • Installed cordova and ionic using npm (every time I reinstalled node.js, I cleaned up everything and started from scratch) with the command line given in the “Getting started” page (sudo npm install -g cordova ionic)
  • Run the command to create a project, like ionic start myApp sidebar

Every time, in every possibile combination of node.js version and install method, I get this (in the last step):

$ ionic start myApp sidemenu
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.<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)

So I tried installing the missing package with npm, using npm install -g xmlbuilder, but another “missing package” error came up, with another package. I started manually installing all of them, but the list was endless and I started to get tired, so I gave up. And, by the way, I don’t think I’m supposed to install every dependency manually.

What am I supposed to do to get a simple Ionic app running?

Thanks in advance.


#2

gdelazzari,

I’m having the same issue on Ubuntu and it looks like we’ve both tried the same stuff as well. I’ve been searching for some answer but no luck. Hopefully someone on here has a solution.


#3

I’m having the same issue on Ubuntu


#4

Same for me on Linux Mint 17.3


#5

Yeah I’m not really sure on this, it seems that npm struggles to install the correct dependencies on Linux. Error: Cannot find module ‘bplist-parser’ is another example of this, and I have no idea what causes it.


#6

I am also having this issue. Do you think it has anything to do with running 64bit or 32 bit Ubuntu versions?


#7

When I was initially trying to install ionic on Ubuntu I had a heap of trouble aswell, I eventually got it working but I later found this https://github.com/nraboy/ubuntu-ionic-installer/. Worked great the last time I used it.


#8

I like that script but still doesn’t solve the problem.


#9

Just setup Ubuntu 14.04.3 in a vm. Ran that script and no issues at all. I had a look at the other issues linked. Have you been running or installed anything here with sudo?


#10

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