Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running npx iconfont-init: Cannot find module 'fs-extra' #17

Open
LeleDallas opened this issue Aug 2, 2023 · 5 comments
Open

Comments

@LeleDallas
Copy link

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:

  1. Create a new React project or use an existing one.
  2. Install react-iconfont-cli by running npm install react-iconfont-cli --save-dev.
  3. 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
@Simoon-F
Copy link

same.

@LeleDallas
Copy link
Author

same.

It seems like the repo hasn't been updated since Oct 2021...

@Simoon-F
Copy link

same.

It seems like the repo hasn't been updated since Oct 2021...

Installation fs-extra can be solved.

@LeleDallas
Copy link
Author

@geekact @fwh1990 Is this repository still under development?

@LeleDallas
Copy link
Author

same.

It seems like the repo hasn't been updated since Oct 2021...

Installation fs-extra can be solved.

Yeah, we can just add it on the installation steps with a PR.
However, whether or not PR gets merged depends on the repository's administrators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants