NodeJS NPM Proxy error when installing grunt

后端 未结 11 1980
太阳男子
太阳男子 2020-12-25 13:58

When I\'m trying to install grunt via npm, I\'m getting a following error:

C:\\Program Files\\nodejs\\node_modules\\npm>npm inst         


        
11条回答
  •  悲&欢浪女
    2020-12-25 14:53

    If you are working behind a proxy in a "windows" domain, add the domain name into the proxy url:

    npm config set proxy http://domain%5Cuser:password@proxy.company.com:8080
    npm config set https-proxy http://domain%5Cuser:password@proxy.company.com:8080
    

    You need to encode the backslash as a http uri string: %5C

    If there are special characters in your username or password, it is necessary to encode these character as well. Keep in mind that these critical informations are stored as plain text in the npm config file (%HOME%\.npmrc). It could also be necessary to point the npm registry to the http source:

    npm config set registry "http://registry.npmjs.org"
    npm config set strict-ssl false
    

提交回复
热议问题