bnoordhuis / node-iconv

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

Fails to install on windows machine #207

Closed kingram6865 closed 4 years ago

kingram6865 commented 4 years ago

Help?

PS PS C:\Users\bob\project> npm install iconv

> iconv@2.3.5 install PS C:\Users\bob\project\node_modules\iconv
> node-gyp rebuild

PS C:\Users\bob\project\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:\Applications\Programming\Python37\python.EXE -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:294:12)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 6.1.7601
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 PS C:\Users\bob\project\node_modules\iconv
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN itbook@1.0.0 No description
npm WARN itbook@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iconv@2.3.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iconv@2.3.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\bob\AppData\Roaming\npm-cache\_logs\2019-12-15T09_49_56_158Z-debug.log
kingram6865 commented 4 years ago

Is it possible that I simply need Visual Studio to build it?

bnoordhuis commented 4 years ago

Yes, but you also need a compatible python version. See https://github.com/nodejs/node-gyp#on-windows (node-gyp is the build tool for add-ons) for prerequisites.

kingram6865 commented 4 years ago

Eh. You can close this. The visual studio installer is broken, there's no support or reasonable response from Microsoft so screw them. I put the code on my Debian server and npm installed iconv instantly.

I was trying to prove a point I guess. And that point is Microsoft sux as a dev environment and people should ditch it. But that's just my 20+ years of experience having it constantly break for unknown reasons.