TooTallNate / plist.js

Mac OS X Plist parser/builder for Node.js and browsers
MIT License
571 stars 123 forks source link

TypeError: Cannot read properties of null (reading 'nodeName') #140

Closed xiatian12345 closed 11 months ago

xiatian12345 commented 1 year ago

my code:

var fs = require('fs'); var plist = require('plist'); var needParse = fs.readFileSync('com.qiuyuzhou.ShadowsocksX-NG.plist', 'utf8'); console.log(needParse); var obj = plist.parse(needParse); console.log(JSON.stringify(obj));

and then the error occurred

TypeError: Cannot read properties of null (reading 'nodeName') at Object.parse (/Users/xiatian/Desktop/temp/node_modules/plist/lib/parse.js:68:25)

xiatian12345 commented 1 year ago

The plist file is here https://github.com/xiatian12345/report/blob/main/com.qiuyuzhou.ShadowsocksX-NG.plist

oopses commented 11 months ago

https://lvv.me/posts/2022/10/01_plutil_example/

plist 不都是xml格式的,目前plist.js只覆盖了xml部分的解析,其他的解析可以参考这个

xiatian12345 commented 11 months ago

https://lvv.me/posts/2022/10/01_plutil_example/

plist 不都是xml格式的,目前plist.js只覆盖了xml部分的解析,其他的解析可以参考这个

好的,多谢