/ Published in: Python
his simple patch solves the problem when building on windows with usernames with non-ascii letters.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
""" https://github.com/TooTallNate/node-gyp/pull/366#issuecomment-47416841 for Windows, If your windows user name is contain non-english characters, go ahead for troubleshoot npm install. Open as your editor below, (node.js folder)\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\easy_xml.py Search for this piece of code, """ # It has changed, write it if existing != xml_string: f = open(path, 'w') f.write(xml_string) f.close() """ and change to, """ # It has changed, write it if existing != xml_string: f = open(path, 'w') try: xml_string = xml_string.encode(encoding) except Exception: xml_string = unicode(xml_string, 'latin-1').encode(encoding) f.write(xml_string) f.close() """ If you not python guy like me, just copy code with indented space, select piece of code with intented space, and paste it. It will work. """
URL: https://github.com/TooTallNate/node-gyp/pull/366#issuecomment-47416841