Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cordova config ls returns Error: ENOENT on clean install #418

Closed
3 tasks done
ltm opened this issue Apr 3, 2019 · 5 comments · Fixed by #421
Closed
3 tasks done

cordova config ls returns Error: ENOENT on clean install #418

ltm opened this issue Apr 3, 2019 · 5 comments · Fixed by #421
Assignees
Labels

Comments

@ltm
Copy link
Contributor

ltm commented Apr 3, 2019

Bug Report

Problem

The configstore dependency was upgraded from 2.1.0 to 4.0.0 in #312. However, as of v4.0.0 configstore no longer creates a configuration file when a config is read (sindresorhus/configstore#57). This causes cordova config ls to return Error: ENOENT if cordova-config.json is missing (e.g. on a clean install).

What is expected to happen?

The command shouldn't return an error (behavior of 8.1.2):

$ rm ~/.config/configstore/cordova-config.json
$ cordova config ls
$

What does actually happen?

The command returns Error: ENOENT:

$ rm ~/.config/configstore/cordova-config.json
$ cordova config ls
Error: ENOENT: no such file or directory, open '/Users/ltm/.config/configstore/cordova-config.json'
$

Information

Command or Code

$ npm install -g cordova@latest
$ rm ~/.config/configstore/cordova-config.json
$ cordova config ls

Environment, Platform, Device

$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.14.4
BuildVersion:	18E226

Version information

$ cordova --version
9.0.0 ([email protected])

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@ltm ltm mentioned this issue Apr 3, 2019
5 tasks
@raphinesse raphinesse added the bug label Apr 10, 2019
raphinesse added a commit to raphinesse/cordova-cli that referenced this issue Apr 10, 2019
raphinesse added a commit to raphinesse/cordova-cli that referenced this issue Apr 10, 2019
@raphinesse raphinesse self-assigned this Apr 10, 2019
raphinesse added a commit that referenced this issue Apr 11, 2019
@mobileben
Copy link

Just curious, I grabbed the latest from npm which is the version cited (9.0.0, [email protected]).

I notice that running cordova platform list, cordova config list generates a no such file or directory for cordova-config.json.

It appears there is no .config directory in my home directory. I could not find any documentation around this directory. Should the install have created it? Or am I expected to create it?

@Arxi
Copy link

Arxi commented Oct 30, 2019

I've just run into this behaviour with clean install of cordova 9.0.0 on MacOS 10.13.6. I have the .config/configstore/ directory in my Home, but there's no cordova-config.json. Is there anything I can do?

@mobileben have you been able to solve this problem?

@mobileben
Copy link

@Arxi Unfortunately no. Never figured it out, so I am just ignoring it.

@Arxi
Copy link

Arxi commented Oct 31, 2019

@mobileben seems like manually creating the file .config/configstore/cordova-config.json with content {} suppresses the error.

@raphinesse
Copy link
Contributor

The issue has been fixed, but there hasn't been a release with the fix yet. That's why you still see this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants