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

Error when starting foreman: Cannot read property '1' #163

Closed
Restuta opened this issue Jan 26, 2019 · 3 comments
Closed

Error when starting foreman: Cannot read property '1' #163

Restuta opened this issue Jan 26, 2019 · 3 comments
Labels

Comments

@Restuta
Copy link

Restuta commented Jan 26, 2019

Freshly installed foreman with npm i -g foreman, mentioned error happens when I try to start it.

❯ nf -V
3.0.1

nf start

/usr/local/lib/node_modules/foreman/lib/envs.js:44
      case '"': return /^"([^"]*)"/.exec(val)[1];
                                             ^

TypeError: Cannot read property '1' of null
    at parseValue (/usr/local/lib/node_modules/foreman/lib/envs.js:44:46)
    at capturePair (/usr/local/lib/node_modules/foreman/lib/envs.js:39:16)
    at Array.forEach (<anonymous>)
    at keyValue (/usr/local/lib/node_modules/foreman/lib/envs.js:27:6)
    at loadEnvsFile (/usr/local/lib/node_modules/foreman/lib/envs.js:138:13)
    at Array.map (<anonymous>)
    at loadEnvs (/usr/local/lib/node_modules/foreman/lib/envs.js:147:30)
    at Command.<anonymous> (/usr/local/lib/node_modules/foreman/nf.js:72:16)
    at Command.listener (/usr/local/lib/node_modules/foreman/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:182:13)
❯ node -v && npm -v
v10.15.0
6.4.1
❯ cat Procfile
web: npm run start:web
to-process-jobs: npm run start:to-process-jobs
to-schedule: npm run start:to-schedule
release: npm run migrate

I think it has something to do with my .env file having multi-line value for one of the variables (RSA key)

@svanweelden
Copy link

If anyone else sees this, I was running into this error until I removed the RSA key from my environment variables so it likely is something to do with .env file having multi-line values. Thanks!

@svanweelden
Copy link

Replacing every new line char in the RSA key with \n seems to do the trick: auth0/node-jsonwebtoken#191

@stale
Copy link

stale bot commented May 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 22, 2019
@stale stale bot closed this as completed May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants