H
Hono2mo ago
Ꚃimon

ERR_UNKNOWN_FILE_EXTENSION when running `bun create hono my-app`

$ bun create hono api
node:internal/errors:497
ErrorCaptureStackTrace(err);
^

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /private/tmp/bunx-501-create-hono@latest/node_modules/create-hono/bin. Loading extensionless files is not supported inside of "type":"module" package.json contexts. The package.json file /private/tmp/bunx-501-create-hono@latest/node_modules/create-hono/package.json caused this "type":"module" context. Try changing /private/tmp/bunx-501-create-hono@latest/node_modules/create-hono/bin 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":{"bin":"./bin.js"}
$ bun create hono api
node:internal/errors:497
ErrorCaptureStackTrace(err);
^

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /private/tmp/bunx-501-create-hono@latest/node_modules/create-hono/bin. Loading extensionless files is not supported inside of "type":"module" package.json contexts. The package.json file /private/tmp/bunx-501-create-hono@latest/node_modules/create-hono/package.json caused this "type":"module" context. Try changing /private/tmp/bunx-501-create-hono@latest/node_modules/create-hono/bin 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":{"bin":"./bin.js"}
11 Replies
Arjix
Arjix2mo ago
you can try using npm/pnpm/yarn instead
Weespies
Weespies2mo ago
when using bun i normally use
bun create hono@latest
bun create hono@latest
ambergristle
ambergristle2mo ago
what bun version are you using? bun create hono works fine on 1.2.13
Swaraj Sahu
Swaraj Sahu2mo ago
I'm getting error on NPM as well npm create hono@latest
ambergristle
ambergristle2mo ago
what's the error you get when running with npm?
Swaraj Sahu
Swaraj Sahu2mo ago
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for C:\Users\Swaraj Sahu\AppData\Local\npm-cache_npx\6ccc1d6f54609fb5\node_modules\create-hono\bin. Loading extensionless files is not supported inside of "type":"module" package.json contexts. The package.json file C:\Users\Swaraj Sahu\AppData\Local\npm-cache_npx\6ccc1d6f54609fb5\node_modules\create-hono\package.json caused this "type":"module" context. Try changing C:\Users\Swaraj Sahu\AppData\Local\npm-cache_npx\6ccc1d6f54609fb5\node_modules\create-hono\bin 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":{"bin":".\bin.js"}}
ambergristle
ambergristle2mo ago
and what version of node are you using? or ig npm
Swaraj Sahu
Swaraj Sahu2mo ago
node v20.9.0 npm v10.1.0
ambergristle
ambergristle2mo ago
i can repro the issue with 20.9.0, but my current version (22.13.0) works fine
Swaraj Sahu
Swaraj Sahu2mo ago
ok let me upgrade node.. and check ok upgraded node to 22. working fine now..
ambergristle
ambergristle2mo ago
dope

Did you find this page helpful?