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

Problem with setting up local environment #1011

Closed
RobJacobson opened this issue Jan 29, 2020 · 5 comments
Closed

Problem with setting up local environment #1011

RobJacobson opened this issue Jan 29, 2020 · 5 comments

Comments

@RobJacobson
Copy link

I'm following the instructions in the Developer Guide for setting up the local environment for the react-map-gl repo. They are:

$ git clone https://github.com/uber/react-map-gl.git
$ cd react-map-gl
$ yarn bootstrap
$ npm run start

When I call "yarn bootstrap," I receive the following error: "'PUPPETEER_SKIP_CHROMIUM_DOWNLOAD' is not recognized as an internal or external command, operable program or batch file."

This is coming from the bootstrap script in package.json, which is: "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn && ocular-bootstrap".

Additionally, if I shorten this bootstrap script to just "ocular-bootstrap" (to remove the Puppeteer reference), I receive another error: "The system cannot find the path specified."

I have tried "yarn add puppeteer" and "yarn add ocular" before calling bootstrap, as well as "yarn install," but none of these helps.

Am I doing something wrong? Is there a way to fix these errors?

Many thanks.

@tsherif
Copy link

tsherif commented Jan 29, 2020

Are you running in a Windows shell? Our scripts are generally set up to run in a posix environment, so on Windows, we recommend using the Windows Subsystem for Linux.

@RobJacobson
Copy link
Author

RobJacobson commented Jan 29, 2020

There's the problem! Yes, I'll confess to the shame of using a Windows 10 environment for development. Bad developer, no donuts for me. 😁

However, I also have Mint installed on a second partition. I'll switch to using that for react-map-gl coding -- I could use the practice with using a Linux dev environment. I'm already using VS Code and other cross-platform tools, so it should be an easy transition.

Thanks so much!

@RobJacobson
Copy link
Author

RobJacobson commented Jan 30, 2020

Well, shoot. I got everything set up on Linux Mint 19.3, but encountered three problems:

First, "yarn bootstrap" failed because of a missing "jq", which sent me down a rabbit hole of attempted problem-solving and frustration. I eventually got this step to work by thinking to call "yarn install" before "yarn bootstrap." Should that install step be added to the documentation?

Second, "npm run start" failed with this error:

> (cd examples/main && yarn && yarn start-local)

sh: 1: cd: can't cd to examples/main
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! react-map-gl@5.2.0 start: `(cd examples/main && yarn && yarn start-local)`
npm ERR! Exit status 2

This is because there isn't a "main" folder in examples. What's the expected behavior when calling "npm run start"?

Third, I called "npm run test." Three tests failed with an http 401 error because "A valid API access token is required to use Mapbox data." Obviously, the downloaded code just has blanks for the access token. Do I need to fill those in manually for each example or is there some other way to insert the access tokens where necessary (like a build script)?

Thanks again.

@Pessimistress
Copy link
Collaborator

  • jq is not by default installed on Linux. I'll fix this issue.
  • The start script needs to be updated too.
  • For the tests to pass You need to set an environment variable: MapboxAccessToken=<local_dev_token>

@Pessimistress
Copy link
Collaborator

@RobJacobson the bootstrap issue should be fixed on master.

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

3 participants