Skip to content

Running via npx results in TypeError [ERR_UNKNOWN_FILE_EXTENSION] #145

Open
@terrablue

Description

@terrablue

Describe the bug
I ran npx share-file-systems. Even though this is not explicitly documented, my naive expectation was that the application would start. I'm not sure if this is simply a missing feature or an actual bug.

This results in
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for $HOME/.npm/_npx/3a4ef2902d19fd14/node_modules/share-file-systems/bin/share-files. Loading extensionless files is not supported inside of "type":"module" package.json contexts. The package.json file $HOME/.npm/_npx/3a4ef2902d19fd14/node_modules/share-file-systems/package.json caused this "type":"module" context. Try changing $HOME/.npm/_npx/3a4ef2902d19fd14/node_modules/share-file-systems/bin/share-files to have a file extension. Note the "bin" field of package.json can point to a file with an extension, for example {"type":"module","bin":{"share-files":"./bin/share-files.js"}}

To Reproduce
Steps to reproduce the behavior:

  1. Open terminal in any directory.
  2. Run npx share-file-systems.

Expected behavior
The application should start.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Browser: Firefox/Chromium
  • Application Version: latest as far as I can tell

Additional context
As it appears from the error message, simply changing the ending of the file in .bin to .js instead of extensionless should solve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions