# Error while updating CLI to Ionic 2

**URL:** <https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387>\
**Category:** ionic-v3\
**Created:** [January 25, 2017, 5:19pm UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387 "2017-01-25T17:19:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thurappan](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@Thurappan](https://forum.ionicframework.com/u/Thurappan)\
**Post date:** [January 25, 2017, 5:19pm UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/1 "2017-01-25T17:19:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ChrisGriiffith](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chrisgriiffith/32/66576_2.png) [@ChrisGriiffith](https://forum.ionicframework.com/u/ChrisGriiffith)\
**Post date:** [January 25, 2017, 5:50pm UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/2 "2017-01-25T17:50:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Thurappan](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@Thurappan](https://forum.ionicframework.com/u/Thurappan)\
**Post date:** [January 25, 2017, 7:09pm UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/3 "2017-01-25T19:09:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Thurappan](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@Thurappan](https://forum.ionicframework.com/u/Thurappan)\
**Post date:** [January 25, 2017, 7:15pm UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/4 "2017-01-25T19:15:35Z")

</div>

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)

```

---

<div class="post-metadata">

**Author:** ![dtgfranca](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dtgfranca/32/104553_2.png) [@dtgfranca](https://forum.ionicframework.com/u/dtgfranca)\
**Post date:** [January 25, 2017, 7:20pm UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/5 "2017-01-25T19:20:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Thurappan](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@Thurappan](https://forum.ionicframework.com/u/Thurappan)\
**Post date:** [January 25, 2017, 7:23pm UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/6 "2017-01-25T19:23:03Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![dtgfranca](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dtgfranca/32/104553_2.png) [@dtgfranca](https://forum.ionicframework.com/u/dtgfranca)\
**Post date:** [January 26, 2017, 12:32am UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/7 "2017-01-26T00:32:36Z")

</div>

> [@Thurappan](#):
>
> npm install -g codova

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

---

<div class="post-metadata">

**Author:** ![Thurappan](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@Thurappan](https://forum.ionicframework.com/u/Thurappan)\
**Post date:** [February 10, 2017, 2:05pm UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/8 "2017-02-10T14:05:25Z")

</div>

I am stuck here ☹  
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

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [February 10, 2017, 8:19pm UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/9 "2017-02-10T20:19:13Z")

</div>

If you try [searching the forums for “enoent rename”](https://forum.ionicframework.com/search?q=enoent%20rename), I bet you will find many threads that tell you specifically what to do.

---

<div class="post-metadata">

**Author:** ![Thurappan](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@Thurappan](https://forum.ionicframework.com/u/Thurappan)\
**Post date:** [February 11, 2017, 7:59am UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/10 "2017-02-11T07:59:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![VibeThemes](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vibethemes/32/106128_2.png) [@VibeThemes](https://forum.ionicframework.com/u/VibeThemes)\
**Post date:** [February 11, 2017, 8:55am UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/11 "2017-02-11T08:55:14Z")

</div>

> [@Thurappan](#):
>
> sudo npm cache clean -f

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 ?

---

<div class="post-metadata">

**Author:** ![Thurappan](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@Thurappan](https://forum.ionicframework.com/u/Thurappan)\
**Post date:** [February 11, 2017, 11:04am UTC](https://forum.ionicframework.com/t/error-while-updating-cli-to-ionic-2/77387/12 "2017-02-11T11:04:43Z")

</div>

That’s what worked for me.
