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

Windows and ENOENT #30

Open
erikpena opened this issue Nov 23, 2021 · 2 comments
Open

Windows and ENOENT #30

erikpena opened this issue Nov 23, 2021 · 2 comments

Comments

@erikpena
Copy link

Summary

It seems that on the Windows platform, when you run the init command for the first time, that there is a difference with how the ENOENT is raised to the NodeJS runtime.

This is a problem because there is a check in the ./src/command-bases/base.ts file that looks for -2 specifically to know if it needs to create a new config.json or not.

Repro

  • On the Windows platform, clone the master branch
  • Run yarn install
  • Run yarn build
  • Run ./bin/run init
  • Observer the exception

Additional details

On the macOS platform, it comes through accompanied with a -2 errno value—

[Error: ENOENT: no such file or directory, open '/Users/erik.pena/.config/@mux/cli/config.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/erik.pena/.config/@mux/cli/config.json'
}

On the Windows platform, it comes through accompanied with a -4058 errno value—

[Error: ENOENT: no such file or directory, open 'C:\Users\erikp\AppData\Local\@mux\cli\config.json'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\erikp\\AppData\\Local\\@mux\\cli\\config.json'
}

I also tested on the Linux platform, it comes through accompanied with a -2 errno (like macOS) value—

[Error: ENOENT: no such file or directory, open '/home/erikpena/.config/@mux/cli/config.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/erikpena/.config/@mux/cli/config.json'
}
@erikpena
Copy link
Author

In reviewing each of exceptions that are coming back, and I think a better check would be to look at the code property of the error and not the errno value. It seems in all three cases, we get the same ENOENT value.

erikpena added a commit that referenced this issue Nov 23, 2021
- Fixed windows issue with config resolution (#30)
- Fixed issue with signing keys (#26)
@erikpena erikpena mentioned this issue Nov 23, 2021
@erikpena
Copy link
Author

I have a PR (#31) that should address this.

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

No branches or pull requests

1 participant