Brave Browser Build Error on Windows

Hi,

I tried to build brave browser in my pc, on windows 8.1 64 bits.

I follow all the guidelines for windows in: https://github.com/brave/brave-browser/wiki/Windows-Development-Environment

I even fetch also in parallel the chromium, but I think that is not necessary right?

When I tried to build the default debug build for brave:

# start the debug compile
npm run build

It gave me this error:

In file included from …/…\brave/content/browser/renderer_host/brave_plugin_reg
istry_impl.h:8:
…/…\content/browser/renderer_host/plugin_registry_impl.h(11,10): fatal error:
‘third_party/blink/public/mojom/plugins/plugin_registry.mojom.h’ file not found

#include “third_party/blink/public/mojom/plugins/plugin_registry.mojom.h”
^~~~~~~~~~~~~~~~
1 error generated.
[373/35127] CXX obj/chrome/file_pre_reader/file_pre_reader_win.obj"(edited)

“[380/35127] ACTION //brave/components/…i(//build/toolchain/win:win_clang_x64)
ninja: build stopped: subcommand failed.
null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! brave@0.59.1 build: node ./scripts/commands.js build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the brave@0.59.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.”

This is also the log that are mention in there:

"0 info it worked if it ends with ok
1 verbose cli [ ‘C:\Program Files\nodejs\node.exe’,
1 verbose cli ‘C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js’,
1 verbose cli ‘run’,
1 verbose cli ‘build’ ]
2 info using npm@6.4.1
3 info using node@v10.13.0
4 verbose run-script [ ‘prebuild’, ‘build’, ‘postbuild’ ]
5 info lifecycle brave@0.59.1~prebuild: brave@0.59.1
6 info lifecycle brave@0.59.1~build: brave@0.59.1
7 verbose lifecycle brave@0.59.1~build: unsafe-perm in lifecycle true
8 verbose lifecycle brave@0.59.1~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\brave-browser\node_modules.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\depot_tools;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Yarn\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs; C:\Users\Ze.cargo\bin;C:\Users\Ze.cargo\bin;C:\Users\Ze\AppData\Local\atom\bin;C:\Users\Ze\AppData\Local\Yarn\bin;C:\Users\Ze\AppData\Roaming\npm
9 verbose lifecycle brave@0.59.1~build: CWD: C:\brave-browser
10 silly lifecycle brave@0.59.1~build: Args: [ ‘/d /s /c’, ‘node ./scripts/commands.js build’ ]
11 silly lifecycle brave@0.59.1~build: Returned: code: 1 signal: null
12 info lifecycle brave@0.59.1~build: Failed to exec build script
13 verbose stack Error: brave@0.59.1 build: node ./scripts/commands.js build
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid brave@0.59.1
15 verbose cwd C:\brave-browser
16 verbose Windows_NT 6.3.9600
17 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “run” “build”
18 verbose node v10.13.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error brave@0.59.1 build: node ./scripts/commands.js build
22 error Exit status 1
23 error Failed at the brave@0.59.1 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
"

Thank you in advance

Not sure what you did but the link you provided is for Windows Development Environment on Github . If you are wanting to install a version of Brave for Windows go to the Brave download page. It looks like this

:smiley: Hope you enjoy Brave as much as I do.

Hi,
if I’m right, the Github files are just for testing and debugging. Use this page to install the latest Brave version:

During the launch of the Chromium Beta I also tried to use the Github files. There I also got an error message.

Have fun with Brave! :slightly_smiling_face:

1 Like

Hi,

thanks for the answers.

Yes, in this case I want to build brave on my pc, not installing in windows OS.

That´s why I shown those messages.

Is this channel the correct one to help in this problem?

Hello @z3bg I am a member of the Brave community and my two main skills are enthusiasm and persistence. To answer your question this ‘channel’ is a forum for troubleshooting , support , and bugs in the use of the Brave browser. It’s my daily driver. The short answer to your question is no this not a development support channel. However ,I hope you would try out the Browser of the future and contribute to the community. The link @MediaBird provided in this thread would be the place to start . Welcome :sunglasses:

Hi @z3bg,
Let me cc @sriram @Mattches to help you on this.

Hi @z3bg,

Couple of questions to you. Did you restart the machine after installing Python? Windows has the issue of not recognizing the install (most times). I would suggest you restart machine and try building again. Secondly is the Python path set in environment variables. It should be C:\Python27\ after you restart the machine. In case if its not done you can manually add it and restart the machine again.

What is brave-core set to? Does it show master or detached head? Since you have already done npm run init here’s what you can try

git reset HEAD -- hard  on (brave-browser)
git pull
cd src/brave (switches to brave-core)
git reset HEAD --hard under /src/brave - Now it should be pointing to master 
cd ../..
npm run init
npm run build (debug build)
npm run start (debug build)

Let me know if this fixes the issue. Once you are able to build successfully the first time you can replace npm run init with npm run sync -- --all which will pull in all changes.

Hi @sriram
@eljuno,

Thank you for answering.

Indeed it was lefting to put in PATH C:\Python27

I´ve added and reboot.

I also uninstall and re-install VS because it was showing afterwards an error about not finding VS-tools.

The question you made of brave-core I didn´t check in the beginning because I didn´t got at first, I just check it afterwards.
I´ve run the code you send and it gave some errors, and now if I run on src/brave folder:

“C:\brave-browser\src\brave>git checkout
M package-lock.json”

Coming back to the code/script you send (this was done after the first time I´ve run it, and it showing different things, but still the problem persists) :

C:\brave-browser>git reset HEAD
Unstaged changes after reset:
D src/.gitkeep

C:\brave-browser>git pull
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.

Then I try to do:

C:\brave-browser>git status
On branch master
Your branch is up to date with ‘origin/master’.

Changes not staged for commit:
(use “git add/rm …” to update what will be committed)
(use “git checkout – …” to discard changes in working directory)

    deleted:    src/.gitkeep

no changes added to commit (use “git add” and/or “git commit -a”)

I´ve done after (I can´t show now all the changes because I´ve done the latest commands and now I can´t see the results):

git checkout – src/.gitkeep

Then

git pull

worked well

cd src/brave
git reset HEAD

(It happens similar thing as in the first case of git reset HEAD on brave-browser folder.
I´ve done the same things and it worked well.)

I then done

npm run init

in brave-browser folder, and it went untill 100%)

On

npm run build

it shows now the error that was giving me in the first place more recently:

“…
C:\brave-browser\src\brave\chromium_src\chrome\installer\setup\brave_behaviors.c
c copied to C:\brave-browser\src\chrome\installer\setup\brave_behaviors.cc
building brave…
update omaha midl files…
gn gen C:\brave-browser\src\out\Debug --args=“safe_browsing_mode=1 root_extra_de
ps=[”//brave”] is_component_build=true proprietary_codecs=true ffmpeg_branding
=“Chrome” enable_nacl=false enable_widevine=true target_cpu=“x64” is_officia
l_build=false is_debug=true dcheck_always_on=true brave_channel=“development”
google_api_key=“AIzaSyAH90V94EcZBP5oH7oc-mXQrSKgASVxER8” brave_google_api_key=
“AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q” brave_google_api_endpoint=“https://
www.googleapis.com/geolocation/v1/geolocate?key=” brave_product_name=“Brave”
brave_project_name=“brave” brave_version_major=“0” brave_version_minor=“59
" brave_version_build=“1” chrome_version_string=“71.0.3578.53” chrome_versio
n_major=“71” safebrowsing_api_endpoint=“safebrowsing.brave.com” brave_referr
als_api_key=”" symbol_level=2 enable_profiling=true is_win_fastlink=true cc_wr
apper=“C:\brave-browser\src\brave\script\redirect-cc.cmd” "
Traceback (most recent call last):
File “C:/brave-browser/src/build/toolchain/win/setup_toolchain.py”, line 292,
in
main()
File “C:/brave-browser/src/build/toolchain/win/setup_toolchain.py”, line 218,
in main
env = _LoadToolchainEnv(cpu, win_sdk_path, target_store)
File “C:/brave-browser/src/build/toolchain/win/setup_toolchain.py”, line 142,
in _LoadToolchainEnv
script_path)
Exception: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\vcv
arsall.bat is missing - make sure VC++ tools are installed.
ERROR at //build/toolchain/win/BUILD.gn:399:22: Script returned non-zero exit co
de.
x64_toolchain_data = exec_script(“setup_toolchain.py”,
^----------
Current dir: C:/brave-browser/src/out/Debug/
Command: C:/brave-browser/vendor/depot_tools/win_tools-2_7_6_bin/python/bin/pyth
on.exe C:/brave-browser/src/build/toolchain/win/setup_toolchain.py “C:\Program F
iles (x86)/Microsoft Visual Studio/2017/Enterprise” “C:\Program Files (x86)\Wind
ows Kits\10” “C:\WINDOWS\Sysnative;C:\WINDOWS/SysWOW64” win x64 environment.x64
Returned 1.
See //BUILD.gn:61:1: which caused the file to be included.
group(“gn_all”) {
^----------------
Traceback (most recent call last):
File “C:/brave-browser/src/build/toolchain/win/setup_toolchain.py”, line 292,
in
main()
File “C:/brave-browser/src/build/toolchain/win/setup_toolchain.py”, line 218,
in main
env = _LoadToolchainEnv(cpu, win_sdk_path, target_store)
File “C:/brave-browser/src/build/toolchain/win/setup_toolchain.py”, line 142,
in _LoadToolchainEnv
script_path)
Exception: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\vcv
arsall.bat is missing - make sure VC++ tools are installed.
null
null
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! brave@0.59.1 build: node ./scripts/commands.js build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the brave@0.59.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ze\AppData\Roaming\npm-cache_logs\2018-11-27T14_22_58_972
Z-debug.log"

The log content is this:

0 info it worked if it ends with ok
1 verbose cli [ ‘C:\Program Files\nodejs\node.exe’,
1 verbose cli ‘C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js’,
1 verbose cli ‘run’,
1 verbose cli ‘build’ ]
2 info using npm@6.4.1
3 info using node@v10.13.0
4 verbose run-script [ ‘prebuild’, ‘build’, ‘postbuild’ ]
5 info lifecycle brave@0.59.1~prebuild: brave@0.59.1
6 info lifecycle brave@0.59.1~build: brave@0.59.1
7 verbose lifecycle brave@0.59.1~build: unsafe-perm in lifecycle true
8 verbose lifecycle brave@0.59.1~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\brave-browser\node_modules.bin;C:\depot_tools;C:\Python27;C:\Python37\Scripts;C:\Python37;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Yarn\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs; C:\Users\Ze.cargo\bin;C:\Program Files\PuTTY;C:\Users\Ze.cargo\bin;C:\Users\Ze\AppData\Local\atom\bin;C:\Users\Ze\AppData\Local\Yarn\bin;C:\Users\Ze\AppData\Roaming\npm
9 verbose lifecycle brave@0.59.1~build: CWD: C:\brave-browser
10 silly lifecycle brave@0.59.1~build: Args: [ ‘/d /s /c’, ‘node ./scripts/commands.js build’ ]
11 silly lifecycle brave@0.59.1~build: Returned: code: 1 signal: null
12 info lifecycle brave@0.59.1~build: Failed to exec build script
13 verbose stack Error: brave@0.59.1 build: node ./scripts/commands.js build
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid brave@0.59.1
15 verbose cwd C:\brave-browser
16 verbose Windows_NT 6.3.9600
17 verbose argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “run” “build”
18 verbose node v10.13.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error brave@0.59.1 build: node ./scripts/commands.js build
22 error Exit status 1
23 error Failed at the brave@0.59.1 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

To check and confirm the command for python path:

C:\brave-browser>where python
C:\depot_tools\python.bat
C:\Python27\python.exe
C:\Python37\python.exe

Probably the error seems it points to VS-tools.
I re-install it as it was put in:
https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#visual-studio

Cheers

I now check that for the folder:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
It don´t have the files they ask.
I´ve installed the Community edition.
Maybe that´s the reason?

I will try to re-install for the Enterprise edition.

I´ve changed the Microsoft Visual Studio from Community edition to Enterprise edition, and now it is running well the command

npm run build

Let´s see if it goes well until the end.

Thank you for the help : )

Hi, but Enterprise is fee-based, I think, after 30 days. It’s not worth it as an individual developer (community is the better choice).

I didn’t follow the whole topic and read every post, but a little comment:
Can’t you change the path somewhere? E.g. on:
C:\Program Files (x86)\Microsoft Visual Studio\2017\ Community

Just the fact that the IDE may not be installed in the default location is important. What if someone installed Visual Studio in the following path?
D:\Visual Studio 2017\Community

You won’t be able to reinstall the community again, so that the path fits.

Translated with www.DeepL.com/Translator

Hi @MediaBird,

Yes I just checked after that it had a limited license.

Yeah the best is to have some workaround that works with Community edition.
It should worked, because in the documentation they tell about that edition.

At least for now I could manage to build and run Brave Browser : )
That´s nice! Thank you for that.

This topic was automatically closed after 30 days. New replies are no longer allowed.