nrwl/add-nx

npx cra-to-nx setup bug

Digital-Coder opened this issue · 7 comments

By running npx cra-to-nx on stock CRA I get

The syntax of the command is incorrect.
Error: Command failed: mkdir -p tools/scripts

at Object.addPostinstallPatch (C:\Users\AppData\Local\npm-cache\_npx\2fef4a1ad32917df\node_modules\cra-to-nx\src\lib\add-postinstall-patch.js:7:21)

Hi there! Version 2.1 is coming up soon and this will most probably be fixed. Which version of CRA are you using?

Hi there! Version 2.1 is coming up soon and this will most probably be fixed. Which version of CRA are you using?

Hi !, I tried with 5.0.0

Nice, ok. Seems to work for me with the new version we have coming up, so once it's published, and it works for you too, I'll close this issue!

Ok, 2.1 published @Digital-Coder ! Can you try if it fixes your issue?

It fixed previous issue 🚀

there is one more. After running nx build I get :
'BUILD_PATH' is not recognized as an internal or external command,
Which is in apps/my-app package.json file

Can you share your repo so that I can take a quick look? Also, can you please try running the nx commands with npx?

eg. npx nx build

https://github.com/Digital-Coder/cra-to-nx-test/commits/master
you can check add nx to cra@5.0 commit in which npx nx build is not working and I fixed it in add build path to craco config commit ,but you will need to fix it for each created project.