atom / node-oniguruma

Oniguruma Node Module
http://atom.github.io/node-oniguruma
MIT License
121 stars 46 forks source link

Installation Error: Invalid Python Syntax #94

Closed ghost closed 5 years ago

ghost commented 5 years ago

Upon installing from NPM the install crashes with the following error

Environment: Void Linux (Kernel 4.18) NodeJS Version: v11.11.0

> node-gyp rebuild

gyp ERR! configure error
gyp ERR! stack Error: Command failed: /home/jb/.asdf/shims/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:297:12)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:984:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
gyp ERR! System Linux 4.18.17_1
gyp ERR! command "/home/jb/.dotfiles/dots/.asdf/installs/nodejs/11.11.0/bin/node" "/home/jb/.dotfiles/dots/.asdf/installs/nodejs/11.11.0/.npm/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/jb/Code/www/node_modules/oniguruma
gyp ERR! node -v v11.11.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/jb/Code/www/node_modules/bin-version/node_modules/cross-spawn/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/jb/Code/www/node_modules/default-gateway/node_modules/cross-spawn/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/jb/Code/www/node_modules/imagemin-mozjpeg/node_modules/cross-spawn/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/jb/Code/www/node_modules/imagemin-pngquant/node_modules/cross-spawn/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/jb/Code/www/node_modules/pngquant-bin/node_modules/cross-spawn/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/jb/Code/www/node_modules/yargs/node_modules/cross-spawn/package.json'
npm WARN babel-plugin-remove-graphql-queries@2.6.3 requires a peer of graphql@^14.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-skip-limit@2.0.6 requires a peer of graphql@^14.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! oniguruma@7.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oniguruma@7.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Aerijo commented 5 years ago

@jbernsie Probably a well known (for anyone who's used it) limitation of node-gyp, that python needs to point to python2.

ghost commented 5 years ago

@Aerijo I switched over to python2 (2.7.16 to be exact) switching to python 2.7 threw the same errors at me, but managed to install node-gyp globally after a bit of dickery with other dependency/conflict issues (not related) :+1: