Can't install any package with node npm

前端 未结 16 1969
一向
一向 2020-12-02 13:12

I\'m trying to install some node packages through npm, but it won\'t go. I\'ve already tried to install/unistall/update node, but nothing seems to work.

I\'m using u

相关标签:
16条回答
  • 2020-12-02 13:51

    1.>Go to your this location

    C:\Users\{your user name or ID}
    

    2.> open .npmrc & Remove all content from .npmrc file.

    3.>reopen your new command prompt

    4.>again run the code , will work.

    0 讨论(0)
  • 2020-12-02 13:52

    The problem is with ssl

    you should use sudo. Follow below method to resolve the issue.

    if you are getting this issue enter sudo npm config set strict-ssl false password: Enter current username password

    then now run all ur command wit sudo sudo npm npm install -g underscore password: Enter current username password

    Even after if your getting error. Your proxy will be problem. few corporate proxy will be blocked, so you should use wifi or open network to fix this issue.

    0 讨论(0)
  • 2020-12-02 13:53

    There is a possibility that your package.json is causing this.

    Parse your package.json to find the unexpected token

    or

    Delete your package.json file and create one through

    npm install 
    
    0 讨论(0)
  • 2020-12-02 13:56

    This worked for me (not using proxy):

    1. set registry mirror for npm..

      npm config set registry http://skimdb.npmjs.com/registry

    found mirror from docs:https://docs.npmjs.com/misc/registry

    1. after this try npm install if it works then try to install whatever you want otherwise follow below steps as well

    3.npm install -g handlebar //i did because it was showing error in npm log but you can skip

    4.after that try to set again official registry

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

    5.now try to install whatever package you want :-)

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