Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from 1.16.0 to 1.16.1 breaks run command #513

Closed
5 tasks done
Jason3S opened this issue Mar 13, 2023 · 6 comments · Fixed by #514
Closed
5 tasks done

Upgrade from 1.16.0 to 1.16.1 breaks run command #513

Jason3S opened this issue Mar 13, 2023 · 6 comments · Fixed by #514

Comments

@Jason3S
Copy link
Contributor

Jason3S commented Mar 13, 2023

Describe the bug

$ lerna run prepare
/usr/bin/env: ‘node\r’: No such file or directory
error Command failed with exit code 127.

Expectation

No response

Reproduction

If it turns out that I'm the only one, then I'll take the time to make a minimal repo.

Lerna config and logs

lerna.json

{
  "npmClient": "yarn",
  "packages": ["dictionaries/*"],
  "useWorkspaces": true,
  "version": "independent",
  "command": {
    "publish": {
      "conventionalCommits": true,
      "ignoreChanges": ["*.md", "package-lock.json", "cspell.json"]
    }
  },
  "changelogPreset": {
    "name": "conventionalcommits",
    "issueUrlFormat": "{{host}}/{{owner}}/{{repository}}/issues/{{id}}"
  }
}

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Environment Info

System:
OS: macOS 13.2.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 2.39 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm
Browsers:
Chrome: 110.0.5481.177
Firefox: 106.0.1
Safari: 16.3
npmPackages:
@lerna-lite/cli: ^1.16.0 => 1.16.1
@lerna-lite/exec: ^1.16.0 => 1.16.1
@lerna-lite/run: ^1.16.0 => 1.16.1

Used Package Manager

yarn 1.x (classic)

Validations

@ghiscoding
Copy link
Member

ghiscoding commented Mar 13, 2023

The only difference in this patch version is the PR #511 and I doubt that would have any impact. I also updated to this version on another monorepo project of mine and lerna run is working fine but I'm on Windows.

Searching for this error, it seems to be related to line ending and it suggest to use Linux LF line ending as per this issue opened in Yarn library. There's also this other Stack Overflow question that also points to line ending. I don't have any Mac or Unix machine so I can't test much from my side but I do use GitHub Action for the open source project and the CI runs fine using a Ubuntu VM which does use a lerna run npm script, so I guess that could count as tested on Unix (however I use pnpm not yarn on that project).

Have you tried rolling back to fixed version of 1.16.0? Here's the list of changes in this patch version, diff changes v1.16.0...v1.16.1

Also in the project I have this .gitattributes which makes sure to use LF to avoid problems like yours (which I had at the beginning), perhaps you could try to have that to your project as well and it might fix your issue? I remember having similar problems before adding the file below, especially with Yarn classing which is what I was using at the beginning before switching to pnpm, Yarn basically said they won't fix it on their side and we have to make sure that we use LF line ending

# never EVER use CRLF, Windows
* text eol=lf

@Jason3S
Copy link
Contributor Author

Jason3S commented Mar 13, 2023

@ghiscoding,

Thank you for looking into this.

It is an issue with the cli/dist, core/dist, etc. directories.

In 1.16.0 the files do NOT contain a CRLF, just a LF.

But in 1.16.1 the files do contain a CRLF.

Did something change in the publishing process?

In any case, would you add to your tsconfig files "newLine": "LF" tsconfig.compilerOptions.newLine?

I think that will help.

@ghiscoding
Copy link
Member

oh yeah you are absolutely right, I did change how I build the project by switching to TypeScript References and tsc -b in the root (in PR #506 and #512) to speed up the build and did not notice that it skipped the setting I had in each package for newLine LF. So thanks for pointing that out, I'll push a fix and release a patch within the hour

@ghiscoding
Copy link
Member

ghiscoding commented Mar 13, 2023

@Jason3S it should be fixed now, I pushed a patch release, give it a try. Cheers and thanks for the feedback and suggestion

@Jason3S
Copy link
Contributor Author

Jason3S commented Mar 14, 2023

@ghiscoding,

Thank you very much for the quick fix. I'll try it out.

@Jason3S
Copy link
Contributor Author

Jason3S commented Mar 14, 2023

Works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants