Ionic-cli: Version 6.9.0 does not work

Created on 13 May 2020  路  21Comments  路  Source: ionic-team/ionic-cli

Description:
Eevry Ioic command fail with the same error TypeError: Cannot set property pathExists

Steps to Reproduce:
Execute an Ionic command

Output:
`ionic cordova platform add [email protected] --no-resources
/usr/local/lib/node_modules/ionic/node_modules/@ionic/utils-fs/dist/index.js:168
exports.pathExists = pathExists;
^

TypeError: Cannot set property pathExists of # which has only a getter
at Object. (/usr/local/lib/node_modules/ionic/node_modules/@ionic/utils-fs/dist/index.js:168:20)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-framework/utils/node.js:3:20)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)

My ionic info:

static:projects distiller$ ionic info
/usr/local/lib/node_modules/ionic/node_modules/@ionic/utils-fs/dist/index.js:168
exports.pathExists = pathExists;
                   ^

TypeError: Cannot set property pathExists of #<Object> which has only a getter
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/@ionic/utils-fs/dist/index.js:168:20)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-framework/utils/node.js:3:20)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)

Other Information:
I'm running in circleci machine created form scrash

triage

Most helpful comment

@rafael-meneses The problem it's with 6.9.0, upgrade to 6.9.1.

If you are using npm i -g ionic, change to npm i -g @ionic/cli

All 21 comments

I'm having the same problem. nothing works. not even the 'ionic info'

@rafael-meneses The problem it's with 6.9.0, upgrade to 6.9.1.

If you are using npm i -g ionic, change to npm i -g @ionic/cli

I ran the following but am still getting the same error with any ionic command

npm uninstall -g @ionic/cli
npm cache clear --force
npm install -g @ionic/[email protected]

@rafael-meneses The problem it's with 6.9.0, upgrade to 6.9.1.

If you are using npm i -g ionic, cahnge to npm i -g @ionic/cli

I already tried that. Even so the 'ionic serve' or 'ionic build' does not work

Duplicate of https://github.com/ionic-team/ionic-cli/issues/4434 (see https://github.com/ionic-team/ionic-cli/issues/4434#issuecomment-627553039)

For those still getting this issue after upgrading to 6.9.1, does ionic --version work? What does it print?

Please also be aware that npm may use cached dependencies when installing, so you may have to clear the cache. I've found npm cache clear --force doesn't always work, you may need to delete the cache directory on your computer manually.

Hey @dwieeb , thanks for the response. The issue is that no ionic commands work, including version or info. All it gives is

"TypeError: Cannot set property pathExists of #Object which has only a getter"

I tried manually deleting the npm-cache and installing ionic cli again, but it didn't work, same error

@rafael-meneses The problem it's with 6.9.0, upgrade to 6.9.1.

If you are using npm i -g ionic, change to npm i -g @ionic/cli

I can confirm that this was my issue too I was using npx but not the right package

npx @ionic/cli build

now works ok.

ionic 5.4.13
Fixing tslib version to [email protected] resolves issue.
npm install -g [email protected]

Yep, for me it's also not working. Tried

npm uninstall -g @ionic/cli npm cache clear --force npm install -g @ionic/[email protected]

and not helped

As @ttrumm said, Had to install [email protected] both locally and globally:

in project folder:
npm install [email protected]

then for global:
npm install -g [email protected]

We are on [email protected] and our pipeline is broken because of this. Setting the tslib version to 1.11.2 locally and globally has not resolved it.

I have just updated to 6.9.1 and everything fails now.

I did try

npm uninstall -g @ionic/cli
npm install -g @ionic/[email protected]

npm cache clear --force

npm install -g @ionic/[email protected]
npm install -g [email protected]

But things doesnt seem to work.

At present, downloading 6.9.0 .. will post result shortly

What about this:

npm -g uninstall cordova ionic
npm -g uninstall @ionic/cli

npm cache clear --force

npm install -g @ionic/cli@latest
npm -g install cordova ionic

same problem with ios

Hi, i have the same Problem ....
"TypeError: Cannot set property pathExists of # which has only a getter"

Can you run a which ionic in Terminal (mac)? that will give you a path and then once you have the result do a ls -l {path}, please confirm if you're using the right package.

Today all is working, don't know how 馃榾

Can you run a which ionic in Terminal (mac)? that will give you a path and then once you have the result do a ls -l {path}, please confirm if you're using the right package.

Macs-MacBook-Pro:~ user$ which ionic
/usr/local/bin/ionic
ls -l /usr/local/bin/ionic
lrwxr-xr-x 1 user admin 35 13 Mag 23:09 /usr/local/bin/ionic -> ../lib/node_modules/ionic/bin/ionic

The downstream issue in tslib has been fixed and a release has been made, so this issue is also fixed in older versions of the Ionic CLI.

Again, npm may used cached packages so you'll need to clear them (see my comment above).

@rycardo74

Can you run a which ionic in Terminal (mac)? that will give you a path and then once you have the result do a ls -l {path}, please confirm if you're using the right package.

Macs-MacBook-Pro:~ user$ which ionic
/usr/local/bin/ionic
ls -l /usr/local/bin/ionic
lrwxr-xr-x 1 user admin 35 13 Mag 23:09 /usr/local/bin/ionic -> ../lib/node_modules/ionic/bin/ionic

With this I can confirm you're using the old package and not the new one @ionic/cli, please uninstall ionic with npm uninstall -g ionic the old one, later make sure the ionic is not install with which ionic, shouldn't appear anymore and then install the cli using npm install -g @ionic/cli the new one, let me know if that works

Was this page helpful?
0 / 5 - 0 ratings