add-nx icon indicating copy to clipboard operation
add-nx copied to clipboard

npx cra-to-nx setup bug

Open Digital-Coder opened this issue 3 years ago • 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)

Digital-Coder avatar Dec 17 '21 12:12 Digital-Coder

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

mandarini avatar Dec 21 '21 12:12 mandarini

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

Digital-Coder avatar Dec 21 '21 13:12 Digital-Coder

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!

mandarini avatar Dec 21 '21 13:12 mandarini

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

mandarini avatar Dec 21 '21 14:12 mandarini

It fixed previous issue :rocket:

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

Digital-Coder avatar Dec 21 '21 17:12 Digital-Coder

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

mandarini avatar Dec 22 '21 10:12 mandarini

https://github.com/Digital-Coder/cra-to-nx-test/commits/master you can check add nx to [email protected] 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.

Digital-Coder avatar Dec 22 '21 10:12 Digital-Coder