Danach zwei Befehle: $ npm config set proxy http://login:pass@host:port
$ npm config set https-proxy http://login:pass@host:port
NPM ist abgestürzt. Wenn ich einen anderen Befehl wie npm install oder npm build eingebe.
Terminal zeigt dies:
URIError: URI malformed
at decodeURIComponent (native)
at Url.parse (url.js:195:19)
at Object.urlParse [as parse] (url.js:84:5)
at Object.validateUrl [as validate] (/usr/share/npm/node_modules/nopt/lib/nopt.js:164:13)
at validate (/usr/share/npm/node_modules/nopt/lib/nopt.js:212:24)
at validate (/usr/share/npm/node_modules/nopt/lib/nopt.js:179:11)
at /usr/share/npm/node_modules/nopt/lib/nopt.js:101:12
at Array.map (native)
at /usr/share/npm/node_modules/nopt/lib/nopt.js:67:15
at Array.forEach (native)
/usr/share/npm/lib/npm.js:34
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.npm.config.get (/usr/share/npm/lib/npm.js:34:13)
at exit (/usr/share/npm/lib/utils/error-handler.js:60:40)
at process.errorHandler (/usr/share/npm/lib/utils/error-handler.js:178:3)
at emitOne (events.js:77:13)
at process.emit (events.js:169:7)
at process._fatalException (node.js:223:26)
Lösung des Problems
Versuchen Sie dies (funktioniert unter Linux)
# To set proxy
npm config set proxy http://username:password@host:port
# To unset proxy
npm config set proxy null
# Check if the proxy is set
npm config get proxy
Keine Kommentare:
Kommentar veröffentlichen