2016-04-20 9 views
0

Ich bin hinter einer Corporate Proxy-Firewall und ich bekomme diesen Fehler, wenn ich Npm Install-Befehl in der Eingabeaufforderung eingeben. vorher wäre es lassen Sie mich die NPM-Datei bearbeiten, die die Proxy-Einstellungen hatte und jetzt bin ich diesen Fehler, egal was npm Befehl i eingeben:Npm-Paket Installationsfehler für Winkel 2

URIError: URI malformed 
at decodeURIComponent <native>  
at Url.parse <url.js:261:19> 
at Object.urlParse [as parse] (url.js:67:5) 
at Object.validateUrl [as validate] (C:\Program F 
m\node_modules\nopt\lib\nopt.js:164:13) 
at validate (C:\Program Files\nodejs\node_modules 
nopt.js:213:24) 
at validate (C:\Program Files\nodejs\node_modules 
nopt.js:179:11) 
at C:\Program Files\nodejs\node_modules\npm\node_ 
1:12 
at Array.map (native) 
at C:\Program Files\nodejs\node_modules\npm\node_ 
:15 
at Array.forEach (native) 

C:\Program Files\nodejs\node_modules\npm\lib\npm.js:3 
    throw new Error('npm.load() required') 
^

Error: npm.load() required 
at Object.npm.config.get (C:\Program Files\nodejs 
s:37:13) 
at exit (C:\Program Files\nodejs\node_modules\npm 
:60:40) 
at process.errorHandler (C:\Program Files\nodejs\ 
error-handler.js:178:3) 
at emitOne (events.js:90:13) 
at process.emit (events.js:182:7) 
at process._fatalException (node.js:236:26) 

--findings--

herausgefunden, dass es hat etwas mit c: \ users {username} .npmrc Datei zu tun. Löschen der Proxy-Einstellungen aus dieser Datei macht den Fehler weg aber dann kann ich keine Pakete herunterladen.

--nprmc file--

;;;; 
; npm userconfig file 
; this is a simple ini-formatted file 
; lines that start with semi-colons are comments. 
; read `npm help config` for help on the various options 
;;;; 

proxy=http://192.168.240.192:8080/ 
registry=http://registry.npmjs.org/ 


;;;; 
; all options with default values 
;;;; 
; access=null 

; always-auth=false 

; also=null 

; bin-links=true 

; browser=null 

; ca=null 

; cafile=undefined 

; cache=C:\Users\test\AppData\Roaming\npm-cache 

; cache-lock-stale=60000 

; cache-lock-retries=10 

; cache-lock-wait=10000 

; cache-max=null 

; cache-min=10 

; cert=null 

; color=true 

; depth=null 

; description=true 

; dev=false 

; dry-run=false 

; editor=notepad.exe 

; engine-strict=false 

; force=false 

; fetch-retries=2 

; fetch-retry-factor=10 

; fetch-retry-mintimeout=10000 

; fetch-retry-maxtimeout=60000 

; git=git 

; git-tag-version=true 

; global=false 

; globalconfig=C:\Users\test\AppData\Roaming\npm\etc\npmrc 

; global-style=false 

; group=0 

; heading=npm 

; if-present=false 

; ignore-scripts=false 

; init-module=C:\Users\test\.npm-init.js 

; init-author-name= 

; init-author-email= 

; init-author-url= 

; init-version=1.0.0 

; init-license=ISC 

; json=false 

; key=null 

; legacy-bundling=false 

; link=false 

; local-address=undefined 

; loglevel=warn 

; long=false 

; maxsockets=50 

; message=%s 

; node-version=5.10.1 

; npat=false 

; onload-script=null 

; only=null 

; optional=true 

; parseable=false 

; prefix=C:\Program Files\nodejs 

; production=false 

; progress=true 

; proprietary-attribs=true 

; proxy=null 

; https-proxy=null 

; user-agent=npm/{npm-version} node/{node-version} {platform} {arch} 

; rebuild-bundle=true 

; registry=https://registry.npmjs.org/ 

; rollback=true 

; save=false 

; save-bundle=false 

; save-dev=false 

; save-exact=false 

; save-optional=false 

; save-prefix=^ 

; scope= 

; searchopts= 

; searchexclude=null 

; searchsort=name 

; shell=C:\WINDOWS\system32\cmd.exe 

; shrinkwrap=true 

; sign-git-tag=false 

; strict-ssl=true 

; tag=latest 

; tag-version-prefix=v 

; tmp=C:\Users\test\AppData\Local\Temp 

; unicode=false 

; unsafe-perm=true 

; usage=false 

; user=0 

; userconfig=C:\Users\test\.npmrc 

; umask=0 

; version=false 

; versions=false 

; viewer=browser 

; _exit=true 

; globalignorefile=C:\Users\test\AppData\Roaming\npm\etc\npmignore 
+2

Könnten Sie schreiben npmrc? – kemsky

+0

gerade hinzugefügt es jetzt – Baahubali

+0

ich habe es geschafft, es mit cntlm arbeiten. Vielen Dank – Baahubali

Antwort

0

fand heraus, dass es etwas mit c zu tun: \ usrs {username} .npmrc Datei. Löschen der Proxy-Einstellungen aus dieser Datei macht den Fehler weg aber dann kann ich keine Pakete herunterladen.

Der beste Weg, gehen durch alle diese Schritte zu vermeiden und es hinter Corporate Proxy bekommen arbeiten, ist cntlm zu verwenden, wie vom Benutzer KOL hier beantwortet: NPM behind NTLM proxy