ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Version 6.9.0 does not work

Open ThonyFD opened this issue 6 years ago • 20 comments

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

ThonyFD avatar May 12 '20 22:05 ThonyFD

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

rafael-meneses avatar May 12 '20 22:05 rafael-meneses

@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

ThonyFD avatar May 12 '20 22:05 ThonyFD

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]

asharm52 avatar May 12 '20 22:05 asharm52

@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

rafael-meneses avatar May 12 '20 22:05 rafael-meneses

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

imhoffd avatar May 12 '20 22:05 imhoffd

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.

imhoffd avatar May 12 '20 22:05 imhoffd

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

asharm52 avatar May 12 '20 23:05 asharm52

@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.

chrux avatar May 13 '20 02:05 chrux

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

ttrumm avatar May 13 '20 09:05 ttrumm

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

VitalikKizlov avatar May 13 '20 14:05 VitalikKizlov

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]

rastafan avatar May 13 '20 14:05 rastafan

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.

stewx avatar May 13 '20 16:05 stewx

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

srinivasangurukannan avatar May 13 '20 16:05 srinivasangurukannan

same problem with ios

rycardo74 avatar May 13 '20 20:05 rycardo74

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

JoergKruse0000 avatar May 14 '20 03:05 JoergKruse0000

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.

chrux avatar May 14 '20 04:05 chrux

Today all is working, don't know how 😀

VitalikKizlov avatar May 14 '20 11:05 VitalikKizlov

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

rycardo74 avatar May 14 '20 20:05 rycardo74

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).

imhoffd avatar May 15 '20 17:05 imhoffd

@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

chrux avatar May 15 '20 22:05 chrux