npm install Error: rollbackFailedOptional

前端 未结 26 910
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 04:26

When I try npm install new packages it shows me this error:

rollbackFailedOptional: verb npm-session 585aaecfe5f9a82

<
相关标签:
26条回答
  • 2020-11-28 04:47

    Make sure you can access the corporate repository you configured in npm is available.Check you VPN connection.

    Else reset it back to default repository like below.

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

    Good Luck!!

    0 讨论(0)
  • 2020-11-28 04:48

    The following commands resolved my issue:

    npm config set proxy http://yourproxyurl.com:8080  (you need to enter your or your company proxy URL and 8080 should be replaced by your proxy port)
    
    npm config set https-proxy http://yourproxyurl.com:8080
    
    0 讨论(0)
  • 2020-11-28 04:48

    For Windows: Run the installer again and choose to 'Repair' the installation

    Worked for me

    0 讨论(0)
  • 2020-11-28 04:49

    I tried following options to fix this issue and it worked.

    1. Uninstall Node.js version 8.
    2. Install Node.js version 6.11.4
    3. Use the registry option along with command to install any package.

    For example to install express I used following command.

    npm install express --registry http://registry.npmjs.org/
    

    or

    npm install express -g --registry http://registry.npmjs.org/
    

    If you want to install locally in any specific folder then use below command. Below command will install express on path C:\Sample\Example1 .

    C:\Sample1\Example1> npm install /Sample/Example1 express --registry http://registry.npmjs.org/
    

    Note: If you are installing locally in a specific location then first go to that directory using command and then run above command. If you are not inside that directory and giving only path in command that will not work.

    If you get package.json missing error then run below command before installing package locally

    C:\Sample\Example1> npm init
    

    above command will create package.json file. No need to provide any data. just hit enter.

    Note: If you are behind a firewall then you may need to set a proxy.

    0 讨论(0)
  • 2020-11-28 04:49

    try this:

    delete all file in folder: %APPDATA%\npm-cache\_locks

    0 讨论(0)
  • 2020-11-28 04:50

    I had the same issue. But it can run properly with switching from company's internal network to visitor network.

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