Skip to content

Fix the CLI behaviour outside a project #165

@alexxander

Description

@alexxander

If the init command is called outside a project the CLI throws the following unfriendly error:

node:fs:590
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open 'package.json'
    at Object.openSync (node:fs:590:3)
    at Object.readFileSync (node:fs:458:35)
    [...]
{
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: 'package.json'
}

Let's add a nicer error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions