npm ERR! Unexpected token < in JSON at position 12842

前端 未结 11 1771
借酒劲吻你
借酒劲吻你 2021-01-01 10:59

Every time I try installing any package or even if I try doing npm install I keep getting this error. I have no idea why I am getting the error. I am totally ne

11条回答
  •  借酒劲吻你
    2021-01-01 11:44

    For me , removing package.lock did not work

    Try the following steps

    1- set registry to https://registry.npmjs.org/. http did not work and had to change it to https

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

    2- I am behind a corporate firewall so i had to setup my proxy and https-proxy accordingly in the format - http://yourproxyurl:port

    npm config set proxy http://someproxyurl.com:8080
    npm config set https-proxy http://someproxyurl.com:8080
    

    3 - Set ssl to false

    npm config set strict-ssl false
    

    These steps worked for me. Hope this helps.

提交回复
热议问题