我想检查所有全局安装的软件包并运行npm list -g --depth 0
。我想卸载一些软件包,例如prop-types,并摆脱其中2个错误。
我想卸载道具类型。我用npm uninstall -g prop-types
做到了,但是没有用。也尝试过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
那react-ga
又如何呢?它没有列出,但看起来它需要一些软件包。如果已安装,如何卸载?这是我尝试卸载时得到的:
~ 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
答案 0 :(得分:1)
要摆脱对等方dep丢失错误,必须删除@gatsby-cli
程序包
npm uninstall -g gatsby-cli