Thanks to visit codestin.com
Credit goes to github.com

Skip to content

0.20.5 has DOS line terminators, breaking knex seed:run #3598

@shanestillwell

Description

@shanestillwell

Environment

Knex version: 0.20.5
Database + version: pg: 7.16.0 (postgres 11.6)
OS: macOs Catalina

Bug

  1. Explain what kind of behaviour you are getting and how you think it should do
    When running knex seed:run, get an error.
$ knex seed:run
env: node\r: No such file or directory
error Command failed with exit code 127.
  1. Error message
$ knex seed:run
env: node\r: No such file or directory
error Command failed with exit code 127.

find . -name "*.js" | xargs file -k {} \;

./lib/constants.js:                                                ASCII text, with CRLF line terminators
./lib/interface.js:                                                ASCII text, with CRLF line terminators
./lib/client.js:                                                   ASCII text, with CRLF line terminators
./lib/transaction.js:                                              ASCII text, with CRLF line terminators
./lib/seed/Seeder.js:                                              ASCII text, with CRLF line terminators
./lib/seed/seed-stub.js:                                           ASCII text, with CRLF line terminators
./lib/logger.js:                                                   ASCII text, with CRLF line terminators
./lib/util/save-async-stack.js:                                    ASCII text, with CRLF line terminators
./lib/util/fake-client.js:                                         ASCII text, with CRLF line terminators
...

All files have dos style line endings. Changing them to unix fixes the problem.

cd node_modules/knex/;
find . -name "*.js" | xargs dos2unix;

Reference:
https://stackoverflow.com/q/18492897/179335

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions