share-file-systems icon indicating copy to clipboard operation
share-file-systems copied to clipboard

Running via npx results in `TypeError [ERR_UNKNOWN_FILE_EXTENSION]`

Open terrablue opened this issue 3 years ago • 1 comments

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.

terrablue avatar Aug 12 '22 22:08 terrablue

I need to research a few things:

  • install the page via npm install into a specified directory without creating node_modules
  • potentially avoiding sudo on linux using ngrok
  • also research possibility of pointing domain to ip 127.0.0.1 in public dns records for both ipv4 and ipv6 records

prettydiff avatar Aug 12 '22 23:08 prettydiff