You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you create a nodemon.json configuration file encoded with BOM such as UTF-8-BOM nodemon fails to load the configuration with the error:
SyntaxError: Unexpected token ? in JSON at position 0
at Object.parse (native)
at <%APPDATA%>\npm\node_modules\nodemon\lib\config\load.
js:180:23
at tryToString (fs.js:456:3)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
[nodemon] Failed to parse config \nodemon.json
The issue seems to be that fs doesn't strip BOM characters by design and JSON.parse [correctly] chokes when it sees the BOM character as invalid JSON.
If you create a nodemon.json configuration file encoded with BOM such as UTF-8-BOM nodemon fails to load the configuration with the error:
SyntaxError: Unexpected token ? in JSON at position 0
at Object.parse (native)
at <%APPDATA%>\npm\node_modules\nodemon\lib\config\load.
js:180:23
at tryToString (fs.js:456:3)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:443:12)
[nodemon] Failed to parse config \nodemon.json
The issue seems to be that fs doesn't strip BOM characters by design and JSON.parse [correctly] chokes when it sees the BOM character as invalid JSON.
See http://stackoverflow.com/questions/24356713/node-js-readfile-error-with-utf8-encoded-file-on-windows
The text was updated successfully, but these errors were encountered: