NodeJS NPM Proxy error when installing grunt

后端 未结 11 1893
太阳男子
太阳男子 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:32

    you can run this in cmd

    npm config set <key> <value> [-g|--global]
    npm config get <key>
    npm config delete <key>
    npm config list
    npm config edit
    npm get <key>
    npm set <key> <value> [-g|--global]
    

    npmrc.txt will run you can change your link and port

     proxy =http://proxy.company.com:8080
    
     https-proxy = http://proxy.company.com:8080
    

    reference

    0 讨论(0)
  • 2020-12-25 14:34

    The error occurs because of the configuration set-up in .npmrc file in the directory C://Users/<username>/.

    Open the .npmrc file in notepad and remove the proxy set up in there. You only need ms build version and ssl set to false as shown in this screenshot.

    This will solve the issue. And now the npm install will work perfectly fine.

    0 讨论(0)
  • 2020-12-25 14:40

    run >> npm config edit

    after open config file in editor, remove following lines

    registry=http://registry.npmjs.org/

    https-proxy=http://host/:port

    strict-ssl=false

    0 讨论(0)
  • 2020-12-25 14:41

    The three thing to make npm working well inside the proxy network .

    This set npm registry , By default it may take https.

    npm config set registry "http://registry.npmjs.org/"

    Second is two set proxy in your system . If your organization use proxy or you.

    npm config set proxy "http://username:password@proxy-url:proxy-port"

    npm config set https-proxy "http://username:password@proxy-url:proxy-port"

    0 讨论(0)
  • 2020-12-25 14:41

    If you're frustrated and none of this monkey-business is working for you, just go Download and run the latest MSI. https://nodejs.org/en/download/

    0 讨论(0)
  • 2020-12-25 14:42

    please use npm config set proxy http://xx.aa.bb.cc:port it worked for me thanks a lot !

    0 讨论(0)
提交回复
热议问题