Issues updating Ionic

I tried to update to the latest version of Ionic using:

npm -i g ionic

When I run it, I get the following error:

C:\ionic>npm i -g iconic
npm WARN deprecated wrench@1.5.9: wrench.js is deprecated! You should check out fs-extra (
n/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note
that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request@2.88.2: request has been deprecated, see
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to
 fsevents 2.

> librsvg@0.7.0 install C:\Users\myuser\AppData\Roaming\.npm-packages\node_modules\iconic\node_modules\librsvg
> node-gyp rebuild

C:\Users\myuser\AppData\Roaming\.npm-packages\node_modules\iconic\node_modules\librsvg>if not defined npm_config_node_gyp
 (node "C:\Users\myuser\AppData\Roaming\.npm-packages\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\nod
e_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\myuser\AppData\Roaming\.npm-packages\node_modules\npm
\node_modules\node-gyp\bin\node-gyp.js" rebuild )
  File "tools/", line 19
    print re.sub(r'-I', '', dirs)
SyntaxError: invalid syntax
gyp: Call to 'python tools/ c:\gtk librsvg-2.0 cairo-png cairo-pdf cairo-svg' returned exit status 1 whil
e in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\myuser\AppData\Roaming\.npm-packages\node_modules\npm\node_modules\
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\myuser\\AppData\\Roaming\\.npm-packages\\node_modules\
\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\myuser\AppData\Roaming\.npm-packages\node_modules\iconic\node_modules\librsvg
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\iconic\node_modules\chokidar\node_modules\
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"an
y"} (current: {"os":"win32","arch":"x64"})

npm ERR! errno 1
npm ERR! librsvg@0.7.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the librsvg@0.7.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\myuser\AppData\Roaming\npm-cache\_logs\2020-08-06T15_22_04_260Z-debug.log

I installed the latest version of nodejs. Still having the same error.

Any idea what is causing that error?

The “iconic” package has “tools for SVG-icons manipulation and icon packs” apparently.

You probably want @ionic/cli instead. See Install the Ionic CLI.

1 Like