I have:
- Forked and cloned the brave-core repo.
- cd-ed to my local copy of brave-core and run npm install
- Tried to run
npm run init
at the root of brave-core
My first issue was with the path of package.json.
The script in the file said
"init": "cd ../../ && npm run --prefix src/brave sync -- --init",
And I had to edit it to:
"init": "npm run sync -- --init",
Now however it tries to locate a .env file which I cannot find in the entire repository.
I can’t shake off the feeling that I’m getting something rudimentary wrong here because all of the docs mention an src/brave path, and I don’t even have an src folder in brave-core.
Could someone please help me out?
Thanks!
@lordmagic not sure if @Mattches might be able to answer or tag in someone to help you on it, but in the meanwhile I did run it by ChatGPT 4o with Canvas to see if can get some potential ideas on your answer. It was saying the following…(for what it’s worth)
It sounds like you’re running into issues with setting up the environment for the Brave core repository. Here are a few things that might help:
-
Correct Path and Script Issue: The original path you mentioned (cd ../../ && npm run --prefix src/brave sync -- --init
) suggests it’s navigating up a few directories and trying to run a command from there. If your folder structure doesn’t match what the script expects, that could explain why it’s not working.
Instead of modifying the script, you might want to verify if the repository was cloned correctly, as the src/brave
folder should exist in the standard structure. It sounds like you could be missing parts of the repo or perhaps cloned an incomplete branch.
-
Missing .env
File: The .env
file might not be included in the repository if it’s a development file containing sensitive data. Often, these files are intentionally left out and a sample .env.example
or similar template is provided for you to copy and adjust locally. You might want to:
- Look for a
.env.example
or similar file that you can rename to .env
.
- Check the documentation or README files; sometimes instructions for setting up the environment are provided there.
- Referencing the Documentation: If the docs mention paths that you don’t see, like
src/brave
, there could be an issue with your cloning process. Ensure that you’re on the correct branch and have fetched all submodules, if applicable. Sometimes projects use Git submodules that need to be initialized separately using:
git submodule update --init --recursive
It might be helpful to double-check the README or setup guide, as they may contain steps specific to your situation.
Sorry to just jump in with an AI reply as I’m sure you could do the same. But this is way outside my field of expertise. Just wanted to see about dropping any data you might not have had while waiting for someone from Brave to respond.
That’s fine. I started a new thread because where I am now is a markedly different issue, but the general problem is the same, i.e. being unable to set up the local dev environment.
Really hoping it gets sorted out