在Mac上设置Node.js.

时间:2017-01-17 14:04:51

标签: node.js

我正在尝试在Mac上使用node.js.它工作正常。但是我需要像这样设置代理命令。

npm config set registry https://registry.nomjs.org

npm config set proxy http://userid:pwd@proxy.***.com:8080

npm config se https-proxy http://userid:pwd@proxy.***.com:8080

当我尝试这些时,我收到了这些错误。

npm install -g express-generator
URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:275:19)
at Object.urlParse [as parse] (url.js:81:5)
at Object.validateUrl [as validate]    (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:164:13)
at validate (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:213:24)
at validate (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:179:11)
at /usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:101:12
at Array.map (native)
at /usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:67:15
at Array.forEach (native)

/usr/local/lib/node_modules/npm/lib/npm.js:39
  throw new Error('npm.load() required')
  ^

Error: npm.load() required
at Object.get (/usr/local/lib/node_modules/npm/lib/npm.js:39:13)
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:60:40)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:180:3)
at emitOne (events.js:96:13)
at process.emit (events.js:188:7)
at processEmit (/usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js:146:32)
at processEmit [as emit] (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js:146:32)
at process._fatalException (bootstrap_node.js:296:26)
 -Mac-mini:~ mobilitycoehybridmacmini$ npm install -g express-generator
URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:275:19)
at Object.urlParse [as parse] (url.js:81:5)
at Object.validateUrl [as validate] (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:164:13)
at validate (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:213:24)
at validate (/usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:179:11)
at /usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:101:12
at Array.map (native)
at   /usr/local/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:67:15
at Array.forEach (native)

 /usr/local/lib/node_modules/npm/lib/npm.js:39
  throw new Error('npm.load() required')
  ^

Error: npm.load() required
at Object.get (/usr/local/lib/node_modules/npm/lib/npm.js:39:13)
at exit (/usr/local/lib/node_modules/npm/lib/utils/error- handler.js:60:40)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:180:3)
at emitOne (events.js:96:13)
at process.emit (events.js:188:7)
at processEmit  (/usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js:146:32)
at processEmit [as emit]   (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js:146:32)
at process._fatalException (bootstrap_node.js:296:26)

任何人都可以帮助我吗? 我尝试重新安装,但它对我没用。

0 个答案:

没有答案