bnoordhuis / node-iconv

node.js iconv bindings - text recoding for fun and profit!
Other
797 stars 123 forks source link

Unable to install #210

Closed pvijaysimha closed 4 years ago

pvijaysimha commented 4 years ago

Getting following error:

\node_modules\iconv>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\ ....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Command failed: C:\Users\Vijay\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "", 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:276:12) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at maybeClose (internal/child_process.js:915:16) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) gyp ERR! System Windows_NT 10.0.16299 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd D:\Work\node_modules\iconv gyp ERR! node -v v8.12.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN worker-loader@1.1.1 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.

bnoordhuis commented 4 years ago

That's not an issue with node-iconv. The version of node-gyp (the build tool for node.js add-ons) that you're using only works with python 2, not 3.

foo123 commented 4 years ago

@bnoordhuis So what is the solution here I am having same installation problem on windows (python 3.6, node 12.18.1)?

bnoordhuis commented 4 years ago

@foo123 You can either install python 2 or upgrade node-gyp / npm to a version that supports python 3 (node-gyp >= 6 - I don't know what npm version that's bundled with.)