Ionic-cli: ionic 4.3.0 command fail due to missing `IONIC_CONFIG_DIRECTORY`

Created on 1 Nov 2018  路  8Comments  路  Source: ionic-team/ionic-cli

Description:

Building ios application on ionic fails due to missing config directory

Steps to Reproduce:

  1. install ionic cli 4.3.0
yarn global add [email protected]
  1. from an ionic project directory, run the command
ionic cordova platform add ios --no-resources

Output:

bash-3.2$ ionic --version
Cannot read property 'IONIC_CONFIG_DIRECTORY' of undefined

My ionic info:

Cannot read property 'IONIC_CONFIG_DIRECTORY' of undefined

Other Information:

  • using version 4.1.2 does not display the error above
bug

Most helpful comment

@brotich Will be fixed in 4.3.1. I need to fix another issue before release

All 8 comments

@brotich What version of Node are you using? This error would imply that process.env is undefined.

@brotich Do you have ionic installed locally? If so, try uninstalling it.

What version of Node are you using? This error would imply that process.env is undefined.

Node version v10.11.0

@brotich Do you have ionic installed locally? If so, try uninstalling it.

  • with the assumption that locally means in the node_modules, i have ionic installed in the globally via yarn global add ionic
  • this is happening also on CircleCI, which is a fresh environment for each test

The interesting path is that i don't have the same issue with version 4.1.2

cc: @dwieeb

@brotich Yes, within node_modules. Could you check?

ls node_modules/ionic

If it does not exist, I'm not sure what could be going wrong. Perhaps try reinstalling it?

@dwieeb

If it does not exist, I'm not sure what could be going wrong. Perhaps try reinstalling it?

  • Its exist(4.0.1), though it is not the same version as the one installed globally (4.3.0)
  • does this interfere in a weird manner having two version of ionic installed?

@brotich Yeah, it's interfering. If the Ionic CLI detects that it is installed locally, it switches contexts and actually runs the local version. This is often how global/local packages work, like gulp or the Angular CLI. I must've missed something in the latest update.

The workaround is to match the global/local versions OR uninstall the local version, unless you need it for some reason:

npm uninstall ionic

@brotich Will be fixed in 4.3.1. I need to fix another issue before release

Thank you for the bug report!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zoinkydoink picture zoinkydoink  路  3Comments

jgw96 picture jgw96  路  3Comments

mpaland picture mpaland  路  3Comments

patwaswapnil picture patwaswapnil  路  3Comments

secret4info picture secret4info  路  3Comments