簡體   English   中英

如何使用Yarn安裝react-phone-number-input?

[英]How to install react-phone-number-input with Yarn?

我想將react-phone-number-input軟件包安裝到我的Reactjs項目中。 我正在使用Yarn作為我的程序包管理器。

所以我做了以下命令

yarn add react-phone-number-input

並收到以下錯誤。

./node_modules/dnd-core/lib/HandlerRegistry.js模塊構建失敗:錯誤:ENOENT:沒有此類文件或目錄,請打開“ /path/to/node_modules/dnd-core/lib/HandlerRegistry.js”

我究竟做錯了什么? 如何使用Yarn安裝react-phone-number-input?

編輯

根據一個答案,我嘗試了以下方法

rm -rf node_modules
yarn autoclean --init # creates .yarnclean file
yarn autoclean --force
yarn install
yarn add react-phone-number-input

並收到以下錯誤。

TypeError:_dndCore.DragDropManager不是構造函數

您可以嘗試刪除node_modules,清理紗線,然后重新安裝。

rm -rf node_modules
yarn cleanup
yarn install
yarn add react-phone-number-input

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM