我安装了节点版本v0.10.35,但是当我尝试使用npm时,它给出了一个错误说:
安装节点时安装了npm,检查节点的版本是否没有抛出 错误,但使用命令npm --version检查npm的版本会抛出错误
Error: npm doesn't work with node v0.10.35
Required: node@0.4 || 0.5 || 0.6
at /usr/lib/node_modules/npm/bin/npm-cli.js:57:23
at Object.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:77:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
npm --version引发错误
npm --version
[TypeError: Object function log(msg, pref, level, cb) {
if (typeof level === "function") cb = level, level = null
var show = log.level
if (show === LEVEL.silent || show === LEVEL.paused) return cb && cb()
if (level == null) level = LEVEL.info
if (isNaN(level)) level = LEVEL[level]
else level = +level
// logging just undefined is almost never the right thing.
// a lot of these are kicking around throughout the codebase
// with relatively unhelpful prefixes.
if (msg === undefined && level > LEVEL.silly) {
msg = new Error("undefined log message")
}
if (typeof msg === "object" && (msg instanceof Error)) level = LEVEL.error
if (!ini.resolved && waitForConfig || level === LEVEL.paused) {
return logBuffer.push([msg, pref, level, cb])
}
if (logBuffer.length && !logBuffer.discharging) {
logBuffer.push([msg, pref, level, cb])
logBuffer.discharging = true
logBuffer.forEach(function (l) { log.apply(null, l) })
logBuffer.length = 0
delete logBuffer.discharging
return
}
log.level = show
npm.emit("log", { level : level, msg : msg, pref : pref, cb : cb })
npm.emit("log."+normalNames[level], { msg : msg, pref : pref, cb : cb })
} has no method 'error']
问题是什么?