ionic-cli: Version 6.9.0 does not work

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 ios@5.1.1 --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 #<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)

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (3 by maintainers)

Most upvoted comments

@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

We are on ionic@4.12.0 and our pipeline is broken because of this. Setting the tslib version to 1.11.2 locally and globally has not resolved it.

As @ttrumm said, Had to install tslib@1.11.2 both locally and globally:

in project folder: npm install tslib@1.11.2

then for global: npm install -g tslib@1.11.2

ionic 5.4.13 Fixing tslib version to tslib@1.11.2 resolves issue. npm install -g tslib@1.11.2

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