-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
When trying to run npx iconfont-init
in my React project after installing react-iconfont-cli
using npm
, I encountered the following error:
Error: Cannot find module 'fs-extra'
Require stack:
- .../node_modules/react-iconfont-cli/commands/createJson.js
To resolve this issue, I installed the fs-extra
module manually using npm i fs-extra
, and after that, the command worked as expected.
Steps to Reproduce:
- Create a new React project or use an existing one.
- Install
react-iconfont-cli
by runningnpm install react-iconfont-cli --save-dev
. - Attempt to run
npx iconfont-init
in the project directory.
Expected Behavior:
npx iconfont-init
should run without any errors and initiate the icon font setup successfully.
Actual Behavior:
The command throws an error: Cannot find module 'fs-extra'
.
Proposed Solution:
It appears that the fs-extra
module is required by the react-iconfont-cli
package, but it was not installed automatically as a dependency. To resolve this issue, users should manually install fs-extra
using the following command:
npm install fs-extra
After installing fs-extra
, running npx iconfont-init
should work as expected.
Additional Information:
- Node version: 18.15.0
- NPM version: 9.5.0
- OS: macOS
Metadata
Metadata
Assignees
Labels
No labels