johnlindquist / kit

Script Kit. Automate Anything.
https://scriptkit.com
MIT License
3.91k stars 138 forks source link

Script is not running from linked local kenv #1317

Open Schmedu opened 1 year ago

Schmedu commented 1 year ago

Hey @johnlindquist, I just tried to add import from a local kenv in a random folder and received this error:

Error: Could not find main module for @johnlindquist/kit
Error: Error: Could not find main module for @johnlindquist/kit

I guess it has something to do with the symlinking. Maybe it would better to move the directory just to ~/.kenv/kenvs, but I am unsure of the mechanics, restrictions, and / or your thoughts about it in general.

There is currently not a good option to add private kenv repos to Kit, the cloning works only for public repos 🤔

johnlindquist commented 1 year ago

That error is usually fixed in the terminal by running:

cd ~/.kenv ~/.knode/bin/npm i ~/.kit

From what I can tell, this usually happens when a user tries to "npm install" in the terminal using an npm other than "~/.knode/bin/npm".

I'm still not able to consistently reproduce, but I think it's because different versions of npm treat the "~/.kenv/.npmrc" config and symlinking differently. It's been a very frustrating issue to nail down 🙃

johnlindquist commented 1 year ago

Also, feel free to use your terminal to clone private repos in your ~/.kenv/kenvs

The Kit workflow uses a built-in JS "git" implementation that can't read your private/ssh credentials