yarn add brain.js not working - no errors but doesnt actually import?

144 views Asked by At

I was trying to install brain.js into my javascript program with npm install brain.js, but this returned an error (it also did this on repl.it, so I don't think its a problem with my computer), so I tried to use yarn. I did yarn add brain.js , which seemed to work, but when I tried to run the examples on GitHub the program said brain was not defined in const net = new brain.NeuralNetwork(config);, which means the library was not imported.

Does anyone know why this isn't working? Keep in mind I am not experienced with javascript and just wanted to try brain.js for myself. I installed yarn with npm install yarn, so I assume this installs the latest version so I put v2 in the tags. Please correct me if I am wrong so I can change it.

0

There are 0 answers