xfiveco / generator-chisel

Chisel is a development framework for creating easy to maintain and fast WordPress websites.
https://www.getchisel.co
MIT License
270 stars 37 forks source link

Too many arguments issue on setup without yarn #495

Closed edenizk closed 2 years ago

edenizk commented 3 years ago

I found the problem causing too many arguments, if you will look at my setup without yarn(image 1) and with yarn(image 2) you will see that npx is somehow diving process.argv into nodes whenever there is a space. I was reading that we can either wrap inside another quote(e.g '"SELECT 1"' ), or wrapping between SELECT 1, or with replace 'SELECT 1'.replace(/ /g, '\ ') (not sure if it will work in Macs tho) and this should solve the problem :slightly_smiling_face: . image (5) image (6)

But even tho this will solve the problem with the DB setup there will be a problem if the user has space in the folder name like "Test 3" and it will also create another too many arguments problem :sweat_smile:. You can also find the description in the execa docs

I have the problem with testing that because some of these commands are inside chisel-plugin-wordpress or chisel-scripts, and they are running from node_modules inside the project(which is pulled from npm package page), I couldn't find a way to test them locally. I have tried to test with the jest, but jest doesn't detect too many arguments problem.

luboskmetko commented 3 years ago

@edenizk thanks for researching this.

@jakub300 can you advise on this? Seems to be pretty common issue (recently one of our candidates got into that too). Thanks

jakub300 commented 2 years ago

This issue is caused by bug in npm (v6 if I remember correctly) on Windows. Issue is not happening after updating npm or using yarn.