简体   繁体   English

npm 添加 react-icons 安装不起作用

[英]npm add react-icons installation does not work

I am new to React and I try to download react-icons , but there is an error, which is different from those I had found here.我是React的新手,我尝试下载react-icons ,但是出现了一个错误,这与我在这里找到的不同。 Can you help, please?你能帮忙吗?

(base) Jana-MacBook-Air:react_project jb$ npm install react-icons --save

Response:回复:

npm WARN saveError ENOENT: no such file or directory, open '/Users/jb/Desktop/react_project/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/jb/Desktop/react_project/package.json'
npm WARN react-icons@4.1.0 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react_project No description
npm WARN react_project No repository field.
npm WARN react_project No README data
npm WARN react_project No license field.

+ react-icons@4.1.0
updated 1 package and audited 1 package in 1.875s
found 0 vulnerabilities

Well, do you have a package.json file in your root path of the project?那么,您的项目根路径中有package.json文件吗? The error is because that package have a peer dependency with react and because it's not finding the package.json file, then for the npm installation process, react it's not installed. The error is because that package have a peer dependency with react and because it's not finding the package.json file, then for the npm installation process, react it's not installed.

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

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