简体   繁体   English

npm 错误! peer dep 丢失: - 如何卸载全局安装的 npm 包?

[英]npm ERR! peer dep missing: - How to uninstall a globally installed npm package?

I wanted to check all my globally installed packages and ran npm list -g --depth 0 .我想检查我所有全局安装的软件包并运行npm list -g --depth 0 I would like to uninstall some packages, for example prop-types and get rid of the error I get with 2 of them.我想卸载一些软件包,例如 prop-types 并摆脱其中 2 个的错误。

I want to uninstall prop-types.我想卸载道具类型。 I did it with npm uninstall -g prop-types but it doesn't work.我用npm uninstall -g prop-types做到了,但它不起作用。 Also tried npm uninstall -g prop-types --save也试过npm uninstall -g prop-types --save

~ npm list -g --depth 0             
/usr/local/lib
├── create-react-app@1.5.2
├── gatsby-cli@2.4.11
├── gitmoji-cli@1.9.2
├── json-server@0.14.2
├── mern-cli@2.5.0
├── nodemon@1.18.6
├── npm@6.9.2
└── strapi@3.0.0-alpha.24.1

npm ERR! peer dep missing: prop-types@^15.6.0, required by react-ga@2.5.7
npm ERR! peer dep missing: react@^15.6.2 || ^16.0, required by react-ga@2.5.7

And what about this react-ga ?那么这个react-ga呢? It's not listed, but it looks like it needs some packages.它没有列出,但看起来它需要一些包。 How can I uninstall it if it's already installed?如果已经安装,如何卸载? This is what I get when I try to uninstall it :这是我尝试卸载它时得到的:

~ npm uninstall react-ga
npm WARN saveError ENOENT: no such file or directory, open '/Users/philippe/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/philippe/package.json'
npm WARN philippe No description
npm WARN philippe No repository field.
npm WARN philippe No README data
npm WARN philippe No license field.

audited 1 package in 0.62s
found 0 vulnerabilities

要摆脱 peer dep missing 错误,您必须删除@gatsby-cli

npm uninstall -g gatsby-cli

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM