Ionic-cli: Updating to ionic 2.1.18 failed

Created on 22 Dec 2016  ·  21Comments  ·  Source: ionic-team/ionic-cli

_From @adirzoari on December 22, 2016 21:37_

Ionic version:2
I'm submitting a bug report & support request.

I'm trying to update ionic 2 version by these commands
npm uninstall cordova ionic
npm install -g cordova ionic

i get these error
C:\Users\adirz\myapps\starter-super>npm install -g cordova ionic npm WARN deprecated [email protected]: use uuid module instead npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: use uuid module instead C:\Users\adirz\AppData\Roaming\npm -- [email protected]
`-- [email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ionic\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN In [email protected] replacing bundled version of cross-spawn with [email protected]
npm WARN In [email protected] replacing bundled version of mime-types with [email protected]
npm WARN In [email protected] replacing bundled version of semver with [email protected]
npm WARN In [email protected] replacing bundled version of form-data with [email protected]
npm WARN In [email protected] replacing bundled version of request with [email protected]
npm WARN In [email protected] replacing bundled version of ionic-app-lib with [email protected]
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\adirz\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "cordova" "ionic"
npm ERR! node v6.9.1
npm ERR! npm v4.0.2
npm ERR! path C:\Users\adirz\AppData\Roaming\npm\node_modules.staging\ansi-f8e54430
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\adirz\AppData\Roaming\npm\node_modules.staging\ansi-f8e54430' -> 'C:\Users\adirz\AppData\Roaming\npm\node_modules\ionic\node_mod
ules\cordova-lib\node_modules\ansi'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\adirz\AppData\Roaming\npm\node_modules.staging\ansi-f8e54430' -> 'C:\Users\adirz\AppData\Roaming\npm\node_modules\ionic\node_mod
ules\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

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\adirz\myapps\אפליקציות טובות להשתמש\starter-super\npm-debug.log

C:\Users\adirz\myapps\starter-super>ionic -v
'ionic' is not recognized as an internal or external command,
operable program or batch file.

00
Update NowLaterRelease Notes
Info`

In addition it says ionic is not recognized
'ionic' is not recognized as an internal or external command,
operable program or batch file.

_Copied from original issue: driftyco/ionic#9766_

old major version

Most helpful comment

@adirzoari
This is what I did:

npm uninstall -g cordova
npm uninstall -g ionic
sudo npm install -g cordova ionic

All 21 comments

Same Problem here, cause was npm version 3.10.5 .
Updating npm to latest 4.x fixed it

npm is now 4.0.5

I updated to npm 4.0.5
But still not working

npm ERR! node v6.9.2 npm ERR! npm v4.0.5

npm install -g npm@latest before npm install -g ionic@latest worked for me.

I'm having this problem too. I have node 7.2.1 and npm 4.0.5

(I'm stuck now as I no longer have Ionic installed and can't re-install it)

From my terminal:

richardshergold$ sudo npm install -g ionic@latest
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: use uuid module instead
npm WARN deprecated [email protected]: use uuid module instead
/usr/local/lib
└── (empty)

npm WARN In [email protected] replacing bundled version of cross-spawn with [email protected]
npm WARN In [email protected] replacing bundled version of semver with [email protected]
npm WARN In [email protected] replacing bundled version of mime-types with [email protected]
npm WARN In [email protected] replacing bundled version of form-data with [email protected]
npm WARN In [email protected] replacing bundled version of request with [email protected]
npm WARN In [email protected] replacing bundled version of ionic-app-lib with [email protected]
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ionic@latest"
npm ERR! node v7.2.1
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

npm ERR! Please include the following file with any support request:
npm ERR! /Users/richardshergold/Ionic Projects/npm-debug.log

in debug.log I have:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'info' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: Invalid package.json
4 verbose stack at /usr/local/lib/node_modules/npm/lib/view.js:84:30
4 verbose stack at ReadFileContext. (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:90:21)
4 verbose stack at ReadFileContext.callback (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16)
4 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:335:13)
5 verbose cwd /Users/richardshergold/Ionic Projects
6 error Darwin 16.3.0
7 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "info"
8 error node v7.2.1
9 error npm v4.0.5
10 error Invalid package.json
11 error If you need help, you may report this error at:
11 error https://github.com/npm/npm/issues
12 verbose exit [ 1, true ]

Solved it. I had to uninstall cordova as wel as ionic. The install worked find after that.

I have the same problem. I uninstall ionic and now i can install the new version.

@richardshergold i'm really confusing. it's shows me different npm version in different folders and not in each folder the ionic works

see here

C:\Users\adirz>npm -v
4.0.5

C:\Users\adirz>ionic -v
2.1.18

C:\Users\adirz>cd myapps

C:\Users\adirz\myapps>cd haversami

C:\Users\adirz\myapps\HaverSami>npm -v
3.10.9

C:\Users\adirz\myapps\HaverSami>ionic -v
'ionic' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\adirz\myapps\HaverSami>

@adirzoari i'm not really an expert on this sort of stuff. Did you try globally uninstalling ionic and cordova and then re-installing (globally). It works for me now.

@richardshergold what commands please?

@adirzoari
This is what I did:

npm uninstall -g cordova
npm uninstall -g ionic
sudo npm install -g cordova ionic

@richardshergold
Thanks for trick
It is working now.

@adirzoari
You must uninstall ionic & cardova

If not worked update node to v 6.9.2
and try
npm uninstall -g cordova
npm uninstall -g ionic
sudo npm install -g cordova ionic

ionic info

Your system information:

Cordova CLI: 6.4.0 
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.3.0
Xcode version: Not installed
npm -v
4.0.5
npm uninstall ionic -g
npm uninstall cordova -g
npm cache clean
npm install cordova -g
npm install ionic -g

@richardshergold thank you it's worked for me!
I uninstalled cordova first then ionic and install all global as you explained..

Thanks work for me

While install ionic using below command:

npm install ionic -g
below error throws:

npm WARN In [email protected] replacing bundled version of ionic-app-lib with ionic-a
[email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\io
nic\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32
"})
npm WARN In [email protected] replacing bundled version of cross-spawn with cross-spa
[email protected]
npm WARN In [email protected] replacing bundled version of semver with [email protected]
npm WARN In [email protected] replacing bundled version of mime-types with mime-types
@2.0.14
npm WARN In [email protected] replacing bundled version of form-data with form-data@0
.2.0
npm WARN In [email protected] replacing bundled version of request with [email protected].
0
npm WARN In [email protected] replacing bundled version of ionic-app-lib with ionic-a
[email protected]

any body help to resolve this issue

Thanks
Anbu

I have tried all the above help, no luck so far.

I am at my root directory and I ran the commands, but cannot get cordova, ionic installed properly.

I have got the following result when I run "npm info" :

npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "info"
npm ERR! node v7.3.0
npm ERR! npm v3.10.10

npm ERR! Invalid package.json
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! /Users/*/npm-debug.log

Can anyone explain me what should be done in order to install cordova, ionic please?
Thanks

Hey I've tried a lot of things but my terminal is still showing me "ionic: command not found"

can anyone help me?

when I tried to install ionic I got this

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: use uuid module instead
npm WARN deprecated [email protected]: use uuid module instead
/Users/jose/.npm-packages/bin/ionic -> /Users/jose/.npm-packages/lib/node_modules/ionic/bin/ionic

[email protected] install /Users/jose/.npm-packages/lib/node_modules/ionic/node_modules/fsevents
node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/jose/.npm-packages/lib/node_modules/ionic/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

Thanks

@josecarvajal8

what is version of node you have ?
update node to v 6.9.2
update npm to latest

after updating
You must uninstall ionic & cardova

try following commands

npm uninstall -g cordova
npm uninstall -g ionic

  • note even if you see "ionic: command not found" you must run ' npm uninstall -g ionic' it will remove ionic completely

sudo npm install -g cordova ionic

@john5db

Man thanks for your time, I have node 6.9.4 and the last version of npm
and I have done those steps several time and it keeps showing "ionic: command not found"

thanks man

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings