diff --git a/index.js b/index.js index 59947e4..acfb0f1 100644 --- a/index.js +++ b/index.js @@ -138,10 +138,14 @@ module.exports = Installer function readJson (jsonPath, name, ignoreMissing) { return readFileAsync(path.join(jsonPath, name), 'utf8') - .then(str => JSON.parse(str)) + .then(str => JSON.parse(stripBOM(str))) .catch({code: 'ENOENT'}, err => { if (!ignoreMissing) { throw err } }) } + +function stripBOM (str) { + return str.replace(/^\uFEFF/, '') +}