如果您的名称包含非英语字符,请使用gyp for windows安装Fir npm。
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如果您的名称包含非英语字符,请使用gyp for windows安装Fir npm。相关的知识,希望对你有一定的参考价值。
his simple patch solves the problem when building on windows with usernames with non-ascii letters.
""" 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) ode_modules pm ode_modules ode-gypgyppylibgypeasy_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. """
以上是关于如果您的名称包含非英语字符,请使用gyp for windows安装Fir npm。的主要内容,如果未能解决你的问题,请参考以下文章