Brain.js: Installation and Build Issues

Created on 6 Oct 2019  路  10Comments  路  Source: BrainJS/brain.js

If you have installation issue please visit and follow instructions;
https://github.com/BrainJS/brain.js#Installation-and-Usage
Or
https://brain.js.org/#/getting-started

Notification

Most helpful comment

@mubaidr I had installed Visual Studio build tools (2015) & Python 2.7 manually before using the npm package mentioned previously. It didn't work. I was later made to understand that one must ensure that (1) Visual C++ build tools workload is being used, (2) the 2017 version is being used, (3) npm config set msvs_version 2017 is run from cmd/powershell.

Also, I already had Python 3 installed on my PC so, I had to set the npm 'python' config key manually.

Request you to incorporate this information when you update the documentation.

All 10 comments

If you have installation issue please visit and follow instructions;
https://github.com/BrainJS/brain.js#Installation-and-Usage
Or
https://brain.js.org/#/getting-started

Documentation isn't working for installation on windows 10. And you people are making loop-hole like go to docs if(fail) come to issues{ go to docs}....

Please explain what exactly is not working during installation, we will try to guide you through this process. Sorry for inconvenience, but since v2 brains now depends on a native module:

Brain.js depends on a native module headless-gl for gpu support. In most cases installing brain.js from npm should just work. However, if you run into problems, this mean prebuilt binaries are not able to download from github reporsitories and you might need to build it yourself.

You need to install Python 2.7 and Visual Studio Build Tools 2015, then run npm install in your project.

The problem was actually with dependency, node-gyp wasn't working properly. Then I found a solution that was node-pre-gyp, which made it compatible with my PC and it works well.

The new installation instructions are inadequate. I have all the dependencies installed, still brain.js would not build on my PC. (Windows 10 x64)

@dhruv-tech Can you give us the error message? Then we can help you more.

@robertleeplummerjr Thanks for your quick reply.

I have figured it out now, but the new installation instructions are genuinely inadequate (at least for Windows). Merely having Python 2.7 and Visual Studio installed on your PC is not enough for node gyp to function properly. You have to install windows build tools using npm for it to work (npm install --global --production windows-build-tools).

Request you to go through the Installation section of the node-gyp documentation and rectify the current version of the brain.js documentation, it is misleading/oversimplified.

[Edit: This is in reference to the Installation and Usage section in the Brain.js documentation]

Also, npm rebuild would not help since, a node-gyp error would abort the npm install process meaning that brain.js files would not be present in the node_modules folder when npm rebuild is run.

Once dependencies for node-gyp are in place, npm install brain.js has to be run again.

@dhruv-tech I will update the instructions since you don't need to install Visual Studio, but Visual Studio Build Tools. The npm package you are referring to, is doing essentially the same. i.e. python and visual studio build tools installation.

@mubaidr I had installed Visual Studio build tools (2015) & Python 2.7 manually before using the npm package mentioned previously. It didn't work. I was later made to understand that one must ensure that (1) Visual C++ build tools workload is being used, (2) the 2017 version is being used, (3) npm config set msvs_version 2017 is run from cmd/powershell.

Also, I already had Python 3 installed on my PC so, I had to set the npm 'python' config key manually.

Request you to incorporate this information when you update the documentation.

Documentation is updated to suggest setting npm config for build tools and python version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TomDobbelaere picture TomDobbelaere  路  6Comments

shopsoy picture shopsoy  路  3Comments

sts-ryan-holton picture sts-ryan-holton  路  3Comments

VEXLife picture VEXLife  路  4Comments

nezzard picture nezzard  路  5Comments