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

npm start stopped working on Windows #49

Open
JoshWhite opened this issue Jan 1, 2021 · 1 comment
Open

npm start stopped working on Windows #49

JoshWhite opened this issue Jan 1, 2021 · 1 comment

Comments

@JoshWhite
Copy link

Hi,

I've been using your package to create and run an application. However, this stopped working about 2 months ago and I'm not sure what caused it - I've just had the chance to delve into what is going on.

When I run npm start I've been getting the following:

[api] >> Command "git grep "^.env$" .gitignore" failed to run
[api] bash ./bin/dev_api.sh exited with code 1
--> Sending SIGTERM to other processes..
[www] Starting the development server...

The API fails to start, because git grep throws an error.

If I comment the following lines in deployNodeApp.js:373-376 out, npm start begins working again:

 if (opts.generateDefaultEnv || opts.generateLocalPortsEnv) {
    const envVars = await generateEnv(metaModules, opts.generateLocalPortsEnv ? format : null)
    const envVarLines = []
    for (const env in envVars) {
      envVarLines.push(`${env}=${envVars[env]}`)
    }
    const content = envVarLines.join('\n') + '\n'
    //checkForGitIgnored('.env')
    //if (format === 'k8s') {
    //  checkForGitIgnored('secrets/')
    //}
    if (output === '-') process.stdout.write(content)
    else await confirmWriteFile('.env', { content, output })
    return null
  }

Not sure what this code is supposed to do - but I assume it's necessary, so not sure how to resolve.
I'm unsure if this is something I've changed in my project, or whether something else has caused this.

Any ideas?

@erulabs
Copy link
Contributor

erulabs commented Jan 9, 2021

Hello! Sorry for the long delay - I'll take a look at this. It seems to be that checkForGitIgnored is assuming the .gitignore file already exists (presumable touch .gitignore would make the code work)... It should create it if it does not exist!

The purpose of that code is to ensure .env and secrets/ are in the .gitignore file, in order to prevent accidental exposure of secrets to the git repo.

Thanks for the repo! I'll get this sorted shortly ❤️

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