knex: Executable node/r not found on Linux

Environment

Knex version: 2.4.1 Database + version: any OS: Ubuntu

Bug

  1. Running knex on Linux fails pretty early with the same behavior of this bug: #4614 . If I manually change within node_modules/.bin/knex from CRLF to LF it runs smoothly.

  2. Error message /usr/bin/env: ‘node\r’: No such file or directory error Command failed with exit code 127.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 13
  • Comments: 19 (3 by maintainers)

Commits related to this issue

Most upvoted comments

@ripecosta Thank you for the tip, added. @ldrick can you please check if 2.4.2 solves the issue for you?

will fix tonight, it’s a result of a different git configuration on my new computer 😕

I will review https://github.com/knex/knex/pull/5460, merge it and release a 2.5.1 as soon as possible.

When I download 2.4.2 this is resolved, but when I install 2.5.0 the issue returns and bin/cli.js has CRLF endings again.

A different (temporary) fix until a new version is published:

package.json before: knex migrate:latest package.json after: npx --yes crlf --set=LF node_modules/knex/bin/cli.js && knex migrate:latest

thanks, need to reconfigure new rig

Any update on this? It’s affecting production builds.

I will release a new version this evening.

Hello, I can confirm that knex 2.5.0 has the issue on MacOS (local) and Linux (CI/CD)

Running: NODE_ENV=test y knex migrate:latest Error: env: node\r: No such file or directory

Node: 18.15.0 Yarn: 1.22.19 Knex: 2.5.0