Error while updating CLI to Ionic 2

I got Err : Code 1 while updating from Ionic 1 to Ionic 2. Kindly help me use Ionic 2

npm ERR! Please include the following file with any support request:
npm ERR! /home/PCNAME/npm-debug.log
npm ERR! code 1

A few pointers that may help ( as appeared on Terminal )

npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
npm WARN deprecated node-uuid@1.3.3: use uuid module instead

I use Ubuntu 16.04 . Thanks.

Try updating your node install first, then reinstall Ionic. Warnings can usually be ignored.

1 Like

Thanks @ChrisGriiffith . Can you please share the commands to

  1. Update Node ( mine showed something like v 6.5.2 )

  2. Uninstall Ionic

  3. Reinstall ionic

I just got this error

$ ionic start myAwesomeApp --v2

Caught exception:
 Error: Cannot find module 'lodash/assign'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/xmlbuilder/lib/index.js:5:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/xmlbuilder/lib/index.js:14:4)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)

try update the node throught:

$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable

And after execute :

npm install -g codova
npm install -g ionic

and try again

1 Like

Thanks @dtgfranca . I already a working version of Ionic 1 CLI. I hope these commands go hand in hand with it.

UPDATE: I just got this error

$ npm install -g codova
npm ERR! Linux 4.4.0-59-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "codova"
npm ERR! node v7.4.0
npm ERR! npm  v4.0.5

npm ERR! Cannot read property 'path' of null
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/PCNAME/npm-debug.log

sorry , the code is npm install -g cordova. Missing the letter R

1 Like

I am stuck here :frowning2:
npm ERR! Linux 4.4.0-62-generic
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “cordova” "ionic"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! path /usr/local/lib/node_modules/.staging/ansi-392b32ed
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/.staging/ansi-392b32ed’ -> '/usr/local/lib/node_modules/ionic/node_modules/cordova-lib/node_modules/ansi’
npm ERR! enoent ENOENT: no such file or directory, rename ‘/usr/local/lib/node_modules/.staging/ansi-392b32ed’ -> '/usr/local/lib/node_modules/ionic/node_modules/cordova-lib/node_modules/ansi’
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

If you try searching the forums for “enoent rename”, I bet you will find many threads that tell you specifically what to do.

1 Like

Using these commands in succession helped solve the install issue.

npm uninstall -g ionic

sudo npm cache clean -f

But, when I cd into the folder and try ionic serve , I get the following error

$ ionic serve
WARN: No node_modules directory found, do you need to run npm install?

Update : It got fixed by itself.

Facing similar issue. do we have to remove the ionic completely and re-install it again, because its a waste of time. Can anyone share details why we get such issues ?

That’s what worked for me.