Closed jcjollant closed 7 years ago
try this var synaptic = require(__dirname + '/dist/synaptic.js'); basicly make sure you have the proper path to it.
another solution is just to install via:
npm install synaptic
like you already did, then the edit the node_modules/synaptic/package.json file, line 73, change the line
"main": "./src/synaptic",
to:
"main": "./dist/synaptic",
@fredylg __dirname was undefined, but it worked pointing directly at the dist synaptic.js . @Loksly I had the npm install, but not the package.json hack. It worked too and looks better in the code. Thank you both!
On top of these I had to prefix all my function calls with "synaptic" which is also missing from the doc. I still feel README.md should be fixed to mention these tricks.
Hi @jcjollant, this was due to the v1.1.0
release from 2 days ago. I just released a hotfix v1.1.1
where this is fixed. You can just bump the version in your dependencies to 1.1.1 and reinstall synaptic, it should be working
I am trying to use this lib with nodeJS v6.10.3 on Windows I followed the readme (npm+example) which gives the following:
The code is not too ambitious:
var synaptic = require('synaptic');
Unless I am missing something obvious, instructions do not work.