You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
Generate a runnable extensionless file (let's call it runcjs):
#!/usr/bin/env node
console.log('hello')
(note that the hashbang has nothing to do with it and can be removed. I just found it out because I was trying to run a file in ./node_modules/.bin and those are usually extensionless)
Run it with node:
node ./runcjs
This works!
Now add a loader (empty mjs file):
node --loader=./empty.mjs ./runcjs
This fails with the exception [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for ../runcjs
This was tested with Node v14.2.0.
The text was updated successfully, but these errors were encountered:
To reproduce:
runcjs
):(note that the hashbang has nothing to do with it and can be removed. I just found it out because I was trying to run a file in
./node_modules/.bin
and those are usually extensionless)This works!
This fails with the exception
[ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for ../runcjs
This was tested with Node v14.2.0.
The text was updated successfully, but these errors were encountered: