[英]How to install react-phone-number-input with Yarn?
I want to install the react-phone-number-input
package into my Reactjs project. 我想将
react-phone-number-input
软件包安装到我的Reactjs项目中。 I am using Yarn as my package manager. 我正在使用Yarn作为我的程序包管理器。
So I did the following command 所以我做了以下命令
yarn add react-phone-number-input
and received the following error. 并收到以下错误。
./node_modules/dnd-core/lib/HandlerRegistry.js Module build failed: Error: ENOENT: no such file or directory, open '/path/to/node_modules/dnd-core/lib/HandlerRegistry.js'
./node_modules/dnd-core/lib/HandlerRegistry.js模块构建失败:错误:ENOENT:没有此类文件或目录,请打开“ /path/to/node_modules/dnd-core/lib/HandlerRegistry.js”
What am I doing wrong? 我究竟做错了什么? How can I use Yarn to install react-phone-number-input?
如何使用Yarn安装react-phone-number-input?
Edit 编辑
Based on an answer, I tried the following 根据一个答案,我尝试了以下方法
rm -rf node_modules
yarn autoclean --init # creates .yarnclean file
yarn autoclean --force
yarn install
yarn add react-phone-number-input
and got the following error. 并收到以下错误。
TypeError: _dndCore.DragDropManager is not a constructor
TypeError:_dndCore.DragDropManager不是构造函数
You can try remove node_modules, clean up yarn, install again. 您可以尝试删除node_modules,清理纱线,然后重新安装。
rm -rf node_modules
yarn cleanup
yarn install
yarn add react-phone-number-input
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.