happy icon indicating copy to clipboard operation
happy copied to clipboard

Windows support

Open cowwoc opened this issue 1 year ago • 6 comments

When I try running happy from within WSL2 in Windows 11 I get this error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\mnt\c\Users\Gili\scoop\apps\nodejs\current\bin\node_modules\happy-coder\bin\happy.mjs' imported from C:\Users\Gili\Documents\retirement-claude
at finalizeResolution (node:internal/modules/esm/resolve:274:11) at moduleResolve (node:internal/modules/esm/resolve:864:10) at defaultResolve (node:internal/modules/esm/resolve:990:11) at nextResolve (node:internal/modules/esm/hooks:748:28) at resolveBase (file:///C:/Users/Gili/scoop/persist/nodejs/cache/_npx/fd45a72a545557e9/node_modules/tsx/dist/esm/index.mjs?1755539845859:2:3811) at resolveDirectory (file:///C:/Users/Gili/scoop/persist/nodejs/cache/_npx/fd45a72a545557e9/node_modules/tsx/dist/esm/index.mjs?1755539845859:2:4310) at resolveTsPaths (file:///C:/Users/Gili/scoop/persist/nodejs/cache/_npx/fd45a72a545557e9/node_modules/tsx/dist/esm/index.mjs?1755539845859:2:5051) at resolve (file:///C:/Users/Gili/scoop/persist/nodejs/cache/_npx/fd45a72a545557e9/node_modules/tsx/dist/esm/index.mjs?1755539845859:2:5428) at nextResolve (node:internal/modules/esm/hooks:748:28) at Hooks.resolve (node:internal/modules/esm/hooks:240:30) { code: 'ERR_MODULE_NOT_FOUND', url: 'file:///C:/mnt/c/Users/Gili/scoop/apps/nodejs/current/bin/node_modules/happy-coder/bin/happy.mjs' }

  1. I am expecting the script to use Linux paths not Windows.
  2. If you're going to use Windows paths, removing mnt\c\ fixes the problem (`C:\Users\Gili\scoop\apps\nodejs\current\bin\node_modules\happy-coder\bin\happy.mjs' exists).

cowwoc avatar Aug 18 '25 18:08 cowwoc

Will see thanks, hopefully someone would contribute windows fix

ex3ndr avatar Aug 18 '25 18:08 ex3ndr

Can @claude suggest a fix?

cowwoc avatar Aug 18 '25 19:08 cowwoc

I use Windows, I'll test and get it working

GrocerPublishAgent avatar Aug 20 '25 01:08 GrocerPublishAgent

I believe I have a fix for this issue in https://github.com/slopus/happy-cli/commit/1afe682248025be6b6575b2be37994280521d085.

The fix is currently on a branch that includes some unreleased beta features that still need stabilization. I'm planning to:

  • Tomorrow: Work through the remaining issues and push out a full release that includes this fix
  • If that's not ready: I'll cherry-pick just this shebang fix and release it separately so you don't have to wait

Either way, you should have a proper fix released within the next day. I'll update this thread once the new version is published to npm.

GrocerPublishAgent avatar Aug 20 '25 07:08 GrocerPublishAgent

@cowwoc We released 0.7.2 with the fix for running on windows. I just tested it on windows 10 and it worked. Please let me know if this fixes the problem. I'll keep the issue open until I hear back. https://www.npmjs.com/package/happy-coder/v/0.7.2

GrocerPublishAgent avatar Aug 22 '25 04:08 GrocerPublishAgent

It worked. Thank you!

cowwoc avatar Aug 22 '25 14:08 cowwoc