cordova prepare 产生错误Error: Non-whitespace before first tag.
时间:2020-04-12 10:02:42|栏目:|点击: 次
这是因为xml文件有bom头的缘故,我们可以在载入xml前去掉头部空白即可。
修改 "你的NPM存放文件路径\node_modules\cordova\src\config_parser.js" 文件:
将
如果仍有错误,查看以下文件xml声明是否正确:
"你的项目目录\platforms\wp8\CordovaWP8AppProj.csproj"
"你的项目目录\platforms\wp8\Properties\WMAppManifest.xml"
修改 "你的NPM存放文件路径\node_modules\cordova\src\config_parser.js" 文件:
将
this.doc = xml.parseElementtreeSync(path);改为
this.doc = new et.ElementTree(fs.readFileSync(path, 'utf-8').replace("\ufeff", ""));
原因见:http://www.multiasking.com/blog/xml2js-sax-js-non-whitespace-before-first-tag/如果仍有错误,查看以下文件xml声明是否正确:
"你的项目目录\platforms\wp8\CordovaWP8AppProj.csproj"
"你的项目目录\platforms\wp8\Properties\WMAppManifest.xml"
<?xml version='1.0' encoding='utf-8'?>
栏 目:
本文标题:cordova prepare 产生错误Error: Non-whitespace before first tag.
本文地址:http://www.codeinn.net/misctech/2235.html






