framework icon indicating copy to clipboard operation
framework copied to clipboard

`env: node\r: No such file or directory` (.bin/maizzle CRLF)

Open DaanVanVugt opened this issue 2 years ago • 10 comments

  • Maizzle Version: 3.7.3
  • Node.js Version: 18.0.0 (and 16.15.0, npm 8.5.5)

It seems that node_modules/.bin/maizzle executable ends up in DOS mode.

Maizzle versions affected: @maizzle/cli:

  • 1.5.1 (1.5.0 and 1.4.0 seem to work, did not test below that)

DaanVanVugt avatar Jun 23 '22 08:06 DaanVanVugt

"@maizzle/framework": "4.0.2"

$ maizzle serve --bin ../../node_modules/@maizzle/framework/src
/usr/bin/env: ‘node\r’: No such file or directory
error Command failed with exit code 127.

some problem

productdevbook avatar Jun 24 '22 07:06 productdevbook

Are you using yarn by any chance? Line endings are automatically handled by npm, but not by yarn.

Might also be related to how Git is set up on your end, both executables have LF line endings:

Framework: https://github.dev/maizzle/framework/blob/master/bin/maizzle CLI: https://github.dev/maizzle/cli/blob/master/bin/maizzle

Tested on a Mac with Maizzle 4.0.2, Node 16 and NPM 8 but I wasn't able to reproduce the issue.

Related #703

cossssmin avatar Jun 24 '22 07:06 cossssmin

Yes, iam used yarn, how to fixed with yarn ?

productdevbook avatar Jun 24 '22 07:06 productdevbook

I don't know if yarn can do this, but you can change the line endings with something like dos2unix-cli:

npm install -g dos2unix-cli

dos2unix path/to/the/maizzle/bin

cossssmin avatar Jun 24 '22 07:06 cossssmin

image

image

productdevbook avatar Jun 24 '22 07:06 productdevbook

Think it's how your Git is checking out those files, as you can see above they're both LF in the repo. You could also check if autocrlf is set to false: git config core.autocrlf.

cossssmin avatar Jun 24 '22 07:06 cossssmin

CLI: https://github.dev/maizzle/cli/blob/master/bin/maizzle dont lf, crlf install, but custom change and fixed.

node modules delete and yarn install some clie dont change lf.

productdevbook avatar Jun 24 '22 07:06 productdevbook

If you look at the pictures, you will see that there is no lf. Look at the first picture.

productdevbook avatar Jun 24 '22 07:06 productdevbook

"@maizzle/cli": "1.5.1" -> change "@maizzle/cli": "1.5.0" and fixed|

i think bug -> https://github.com/maizzle/cli/commit/6a5849b7585038a0c5f2247b0ab56e76778dc2a0

productdevbook avatar Jun 24 '22 19:06 productdevbook

If you look at the pictures, you will see that there is no lf. Look at the first picture.

But that's on your machine locally, they're both LF in the repo. Again, might be something specific to how yarn installs packages and copies their files to disk, I'm not sure since I can't reproduce it 🤔

cossssmin avatar Jun 28 '22 10:06 cossssmin