npm install Error: rollbackFailedOptional

前端 未结 26 913
佛祖请我去吃肉
佛祖请我去吃肉 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 05:07

    Try this

    npm config rm proxy
    npm config rm https-proxy
    
    0 讨论(0)
  • 2020-11-28 05:07

    The cause for this might be your current NPM registry. Try to check for a .npmrc file. These can be at various locations:

    • per-project config file (/path/to/my/project/.npmrc)
    • per-user config file (~/.npmrc)
    • global config file ($PREFIX/etc/npmrc)
    • npm builtin config file (/path/to/npm/npmrc)

    Within these there can be something like

    registry=https://mycustomregistry.example.org
    

    which will take priority over the default one (http://registry.npmjs.org/). You can delete this line in the file or use the default registry like that:

    npm <command> --registry http://registry.npmjs.org/
    
    0 讨论(0)
  • 2020-11-28 05:07

    Mine was due to McAfee firewall. It is set to Ask mode, so should have popped up a prompt to ask for internet connection, but it didn't! Going into McAfee and (temporarily!) disabling the firewall allowed me to install.

    0 讨论(0)
  • 2020-11-28 05:08

    Hi I'm also new to react and I also faced this problem after so many trouble I found solution: Just run in your command prompt or terminal :

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

    This will resolve your problem. Reference link: http://blog.csdn.net/zhalcie2011/article/details/78726679

    0 讨论(0)
  • 2020-11-28 05:08

    I had the same effect creating a react app with PhpStorm. And then at the end it just says done. Running the same command in the terminal gave me detailed errors. The project folder I've created was named react which seems to be a no-go.

    Make sure your project folder is not named react.

    0 讨论(0)
  • 2020-11-28 05:12

    Solution: The default value of ‘proxy’ and ‘https-proxy’ key of npm config is NULL. After doing some more R & D then I tried to set the proxy setting value to above key (this solution works in my scenario).

    Also, the same proxy settings need to be applied in IE browser Internet Settings >> Settings >> LAN settings.

    Conclusion: In corporate/some environment the proxy is a somewhat mandatory setting otherwise npm install will not work.

    Issue on GitHub: https://github.com/SharePoint/sp-dev-docs/issues/3266

    You can refer blog for detailed information https://blogs2share.blogspot.com/2019/01/spfx-environment-setup-error.html

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