Closed lorefnon closed 5 years ago
https://www.npmjs.com/package/hunspell-asm may be a viable alternative.
It would take time and efforts to move to an alternative. IMO the best thing to do is to wait for atom/node-spellchecker#119 to be fixed. Until then I'm afraid you will have to use a prior version of node to build Abricotine. Maybe nvm can be helpful for this.
let's keep your recommendation about hunspell-asm in mind anyway. It can be useful in the long term to avoid native modules.
Rather than opening a new issue related to spellchecker and node-gyp, I'll comment here, even though this one is closed.
I am trying to set up the development branch locally and so far have had no success either on Windows 10 or Ubuntu 20.04. The errors are related to node-gyp and spellchecker. Since I am currently on Ubuntu I will detail my attempts related to that.
I have tried 3 different node versions, using nvm, and all give me similar errors. Node versions I tried with are: v14.15.0
v15.14.0
v16.13.0 (LTS)
, all with the default npm versions that come when installing using nvm
.
When attempting the install with v14 I get a huge error similar to the one in the issue. When using v15 and v16 though I get
npm ERR! path /home/tokelin/development/open-source/abricotine/node_modules/spellchecker
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.13.0 | linux | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "<string>", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Linux 5.11.0-38-generic
npm ERR! gyp ERR! command "/home/tokelin/.nvm/versions/node/v16.13.0/bin/node" "/home/tokelin/development/open-source/abricotine/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/tokelin/development/open-source/abricotine/node_modules/spellchecker
npm ERR! gyp ERR! node -v v16.13.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
This makes me thing it's an error with Python on Ubuntu. python3
shows that I have 3.8.10
installed. I installed a package python-is-python3
which aliases python
to python3
, but the error tells me the package (node-gyp or spellchecker) is looking for python2. After removing the python-is-python3
package, so that python
gives an error (as it should on Ubuntu 20.04) the npm error output changes to
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
Which leads me to believe node-gyp (or spellchecker) needs python v2.X when calling python
. I will install it and see if that fixes the error.
In any case... I would say replacing spellchecker as a dependency would be a good idea. I completely understand it won't be a simple undertaking, as a spellchecker is essential in any editing software and is probably used throughout the whole application.
Update: After installing Python 2.7.18 and aliasing it to python
using python-is-python2
I still get a huge wall of text as an error.
I believe this is related to https://github.com/atom/node-spellchecker/issues/119
https://www.npmjs.com/package/hunspell-asm may be a viable alternative.