I followed a few guides available online to install Ionic in Ubuntu 14.04 LTS. I could go as far as using the command
ionic start myApp1 blank
but it throws an error everytime. I checked with nodejs team. They seem to believe it has something to do with setting up framework. The following is the error I get
`$ ionic start myApp1 blank
module.js:341
throw err;
^
Error: Cannot find module 'archiver'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/utils.js:3:16)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
Plese help me fix it
What were the steps you did to install? What version does it say of ionic and ionic cli does your system say you have installed?
1 Like
Thanks for the reply @polska03
I just typed
$ ionic -v
It too gave the same error
I already had Android studio installed. So I just used the rest of the commands from this guide
http://samhassell.com/getting-ionic-framework-up-and-running-on-ubuntu-14-04/
The node version referenced in that page is ancient. Try using nvm to install 4.4.3 and then try using npm to install ionic again.
1 Like
Thanks you @rapropos
Can you give the command to do the same as well please ?
I used
sudo apt-get remove --purge nodejs npm
to remove current nodejs and npm and then tried
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install nodejs
But when I try the following command ( after reinstalling corodova and ionic )
ionic -v
I get this error
$ ionic -v
module.js:327
throw err;
^
Error: Cannot find module 'archiver'
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/ionic-app-lib/lib/utils.js:3:16)
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)
at Module.require (module.js:353:17)
What to do ?
PS : I used this guide
I donβt use Ubuntu, so I canβt comment on how their packaged versions of node work. If somebody else can help you there, that would be great, but if you would like to try an alternative (which doesnβt need root privileges and stores everything inside your user directory), I have had good luck with nvm.
1 Like
@rapropos
I have installed nvm, what to do next ?
As of now, it says
You currently have modules installed globally with
npm. These will no => longer be linked to the active version of Node when you install a new node => with
nvm; and they may (depending on how you construct your
$PATH) => override the binaries of modules installed with
nvm`:
/usr/lib
βββ bower@1.7.9
βββ cordova@6.1.1
βββ grunt-cli@1.1.0
βββ gulp@3.9.1
βββ gulp-util@3.0.7
βββ ionic@1.7.14
=> If you wish to uninstall them at a later point (or re-install them under your
=> nvm
Nodes), you can remove them from the system Node as follows:
$ nvm use system
$ npm uninstall -g a_module
=> Close and reopen your terminal to start using nvm
`
Some help will be appreciated.