"If you plan to publish your package, the most important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version. If you don’t plan to publish your package, the name and version fields are optional."
According to the documentation on https:/ /docs.npmjs. com/files/ package. json
"If you plan to publish your package, the most important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version. If you don’t plan to publish your package, the name and version fields are optional."
Looking at the NPM source code : /github. com/npm/ cli/blob/ latest/ lib/npm. js
https:/
It appears NPM treats this as an exception:
try { fs.readFileSync ( join(__ dirname, '../package.json')) + '') info('error reading version', ex)
// startup, ok to do this synchronously
var j = parseJSON(
path.
npm.name = j.name
npm.version = j.version
} catch (ex) {
try {
log.
} catch (er) {}
npm.version = ex
}