create-react-component-folder icon indicating copy to clipboard operation
create-react-component-folder copied to clipboard

The "path" argument must be of type string. Received undefined

Open diemax opened this issue 5 years ago • 1 comments

Hello! Great project 😄

When I try to run

$ npx crcf --createindex

I get this error:
The "path" argument must be of type string. Received undefined This happens either if I run the command in the root folder where components/ folder is or inside components/
I followed the instructions and I installed the package running:

$ npm install --save-dev create-react-component-folder 

Any thoughts? 😄

Thank you!

diemax avatar Apr 21 '20 07:04 diemax

@diemax Thank you for your great compliments. Nice to hear that someone is using it :)

So the docs aren't so clear for using this feature. What you will have to do is to first create your components inside let's say a directory called /components.

You can run

npx crcf components/Home About Contact

And that will create a components folder and those three components like you can see in the image below

image

Next you can run

npx crcf --createindex components

Which will create the index.js file in the root of the components directory image

And there you this is what the index file will look like

image

snaerth avatar Apr 24 '20 12:04 snaerth