Planeshifter / node-word2vec

Node.js interface to the Google word2vec tool.
Apache License 2.0
348 stars 55 forks source link

"Child process exited with code 126" error #25

Open bao153 opened 3 years ago

bao153 commented 3 years ago

When I ran: const w2v = require( 'word2vec' ); const corpusFilePath = 'cleared_words.txt';

w2v.word2vec(corpusFilePath, "vectors.txt", { size: 300 }, () => { console.log("DONE"); });

It returns: Child process exited with code 126 DONE

leaving vectors.txt unchanged. Is this because I'm running this on MacOS?

Planeshifter commented 3 years ago

Hmm, not sure. Does the cleared_words.txt file exist in the directory from which you run the script? You might try supplying either an absolute or relative file path as in in the following example. Alternatively, I should be able to test it on MacOS by tomorrow.

bao153 commented 3 years ago

So it turned out that the executables in the /src directory didn't have execution permission but chmod +x-ing them didn't actually work either. Then, following https://stackoverflow.com/questions/64706647/why-am-i-getting-a-zsh-exec-format-error, I did make clean and make and it worked! Wonderful how the solution came from an answer not directly addressing "Child process exited with code 126" at all. Adding the commands to recompile source code on user's computer at installation would be really helpful. Thank you!