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

Could the error if you try to run npm run dev without having run npm install be improved? #2288

Open
oscarduignan opened this issue Aug 4, 2023 · 1 comment

Comments

@oscarduignan
Copy link

Context

When someone tries to run npm run dev without having run npm install they see an error like this:

$ npm run dev
> dev
> govuk-prototype-kit dev
'govuk-prototype-kit' is not recognized as an internal or external command,
operable program or batch file.

Would it be possible for the dev script to check to let the user know if they might need to run npm install?

What I mean is something like

{
  "scripts": {
    "dev": "npm run check-if-npm-install-has-been-run && govuk-prototype-kit dev"
  }
}

Alternatives

guess there might be other ways to inform user to remember to run npm install

Additional information (if applicable)

N/A

@frankieroberto
Copy link
Contributor

I like this idea. It'd especially benefit people to try to run prototypes created by other people. The error can be quite cryptic, depending on what’s previously been installed.

It might even be better to actually run npm install every time that npm run dev is run? It adds a small time delay overhead, but on my machine at least it's less than a second if everything is installed already.

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

2 participants