Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/read-json.js')
-rw-r--r--lib/utils/read-json.js19
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/utils/read-json.js b/lib/utils/read-json.js
index 6d4b73ac7..aa3b93003 100644
--- a/lib/utils/read-json.js
+++ b/lib/utils/read-json.js
@@ -179,7 +179,7 @@ function processObject (opts, cb) { return function (er, json) {
// uncomment once this is no longer an issue.
// if (cb) return cb(e)
// throw e
- log.error(msg, "incorrect json")
+ log.error(msg, "incorrect json: "+json.name)
json.repostory = json.repositories[0]
delete json.repositories
}
@@ -219,19 +219,9 @@ function processObject (opts, cb) { return function (er, json) {
if (tag) json.version = tag//+"-"+json.version
if (json.modules) {
- if (typeof json.modules !== "object") {
- var e = new Error("Invalid modules object")
- if (cb) return cb(e)
- throw e
- }
- Object.keys(json.modules).forEach(function (mod) {
- if (typeof json.modules[mod] !== "string") {
- var e = new Error("Invalid module "+mod+", not a string: "
- +JSON.stringify(json.modules[mod]))
- if (cb) return cb(e)
- throw e
- }
- })
+ var e = new Error("modules object is deprecated")
+ log.error(e, "incorrect json: "+json.name)
+ delete json.modules
}
var scripts = json.scripts || {}
@@ -288,7 +278,6 @@ function processObject (opts, cb) { return function (er, json) {
})
}
-
json._id = json.name+"@"+json.version
json = testEngine(json)
json = parsePeople(unParsePeople(json))