npm install without ssl

前端 未结 4 1496
遇见更好的自我
遇见更好的自我 2020-12-04 15:43

I have an Ubuntu VM that is having trouble connecting to sites with ssl, i.e. https. It can successfully download artifacts from the internet if the url begins with http.

4条回答
  •  甜味超标
    2020-12-04 15:58

    As conlinf said, the following should work :

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

    Now, to add my word, you should also consider that downloading without ssl allows a man-in-the-middle attack. It is only to add a warning to people who would read the post.

    If you are a solo developer there should be not much trouble downloading in http directly, but if I wanted to attack a company using node.js I would consider delivering malicious code through npm... And performing such an attack without ssl will be much easier.

提交回复
热议问题