diff options
author | Rebecca Turner <me@re-becca.org> | 2015-02-22 10:37:50 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-07-01 14:09:38 +0300 |
commit | 28064e5070dbe38df5281a4a0e14364f4100aadc (patch) | |
tree | be925388fb6aa2a8863fa4422429f0f83adc84b8 /lib/npm.js | |
parent | 2875ba3fe676339e887bc61e48596564e3565678 (diff) |
install: version: Fix package.json handling to always allow BOM at start
Fixes: #3358
PR-URL: https://github.com/npm/npm/pull/8724
Diffstat (limited to 'lib/npm.js')
-rw-r--r-- | lib/npm.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/npm.js b/lib/npm.js index 8a079c21f..92b38ec88 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -26,6 +26,7 @@ var abbrev = require('abbrev') var which = require('which') var CachingRegClient = require('./cache/caching-client.js') + var parseJSON = require('./utils/parse-json.js') npm.config = { loaded: false, @@ -43,7 +44,7 @@ try { // startup, ok to do this synchronously - var j = JSON.parse(fs.readFileSync( + var j = parseJSON(fs.readFileSync( path.join(__dirname, '../package.json')) + '') npm.version = j.version } catch (ex) { |