question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BROWSER env variable does not work with arguments

See original GitHub issue

Is this a bug report?

Not sure

Which terms did you search for in User Guide?

https://facebook.github.io/create-react-app/docs/advanced-configuration

Steps to Reproduce

Create a .env file with the following content:

BROWSER=google-chrome-stable --remote-debugging-port=9222

Also tried BROWSER=google-chrome-stable, --remote-debugging-port=9222 (with a comma)

Works with BROWSER=google-chrome-stable only

Expected Behavior

Opens Chrome

Actual Behavior

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn google-chrome-stable --remote-debugging-port=9222 ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-example-modern-redux@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-example-modern-redux@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/arvigeus/.npm/_logs/2019-06-15T04_19_29_214Z-debug.log
The terminal process terminated with exit code: 1

npm debug log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'start' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle react-example-modern-redux@0.1.0~prestart: react-example-modern-redux@0.1.0
6 info lifecycle react-example-modern-redux@0.1.0~start: react-example-modern-redux@0.1.0
7 verbose lifecycle react-example-modern-redux@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle react-example-modern-redux@0.1.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/media/data/Workspace/arvigeus/react-example-modern-redux/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle react-example-modern-redux@0.1.0~start: CWD: /media/data/Workspace/arvigeus/react-example-modern-redux
10 silly lifecycle react-example-modern-redux@0.1.0~start: Args: [ '-c', 'react-scripts start' ]
11 silly lifecycle react-example-modern-redux@0.1.0~start: Returned: code: 1  signal: null
12 info lifecycle react-example-modern-redux@0.1.0~start: Failed to exec start script
13 verbose stack Error: react-example-modern-redux@0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid react-example-modern-redux@0.1.0
15 verbose cwd /media/data/Workspace/arvigeus/react-example-modern-redux
16 verbose Linux 4.15.0-51-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "start"
18 verbose node v10.16.0
19 verbose npm  v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error react-example-modern-redux@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the react-example-modern-redux@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Related issues

#1974, #2510

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
arvigeuscommented, Jun 25, 2019

Made a PR yesterday. It has one test failing for no reason, and I can’t figure why…

1reaction
miraagecommented, Jun 17, 2019

@arvigeus I’d suggest you to open a proposal issue to add a new environment variable (e.g. BROWSER_OPTIONS) which will be passed to open package

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment variable expansion syntax in the arguments of ...
Is there any way to expand environment variable in the arguments syntax? I've tried: %APPDATA% ${APPDATA} ${env:APPDATA} (${APPDATA}).
Read more >
How do I put an argument into the BROWSER variable?
How do I put an argument into the BROWSER variable? ; Does it work if you rename your configuration file into ~/.lynxrc and...
Read more >
Environment Variables - Remix
While they can be useful for bundling code, traditionally those are "build arguments" not environment variables. Environment variables are most useful at ...
Read more >
Use environment variables | Cloud Run Documentation
When you set environment variables, they are injected into the container and are accessible to your code. Environment variables are set as key/value...
Read more >
PATH and CLASSPATH (The Java™ Tutorials > Essential ...
If the PATH environment variable does not exist, click New . ... You can run the JDK just fine without setting the PATH...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found