Skip to content

Unable to invoke terraform when line feed is CRLF #243

@DaemonDude23

Description

@DaemonDude23

This is mostly for posterity as I've identified the cause of the problem and it's an easy fix.

tfenv 2.2.0

Issue:
If the .terraform-version file is set to CRLF (not LF), and you have an empty newline in it like so:

0.14.6

If you try to run a terraform command or tfenv use 0.14.6, you'll get:

Switching default version to v0.14.6
Default version file overridden by /BLA/BLA/.terraform-version, changing the default version has no effect
No versions matching '' found in remote
/terraform: No such file or directorynv/2.2.0/libexec/tfenv-exec: line 105: /home/linuxbrew/.linuxbrew/Cellar/tfenv/2.2.0/versions/0.14.6
'terraform version' failed. Something is seriously wrong

The fix:
Remove the blank newline, or switch the file's line feed to LF

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