Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation issue #14

Open
Nicholas0350 opened this issue Feb 9, 2025 · 7 comments
Open

Installation issue #14

Nicholas0350 opened this issue Feb 9, 2025 · 7 comments

Comments

@Nicholas0350
Copy link

Nicholas0350 commented Feb 9, 2025

install complaining on Node version on playwright

seems to be a deeper issue with cursor-tools and its ESM imports. Let's try a complete cleanup and reinstall:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'playwright' imported from /Users/nicholas/.npm/_npx/99e823aa0445d96b/node_modules/cursor-tools/dist/index.mjs at packageResolve (node:internal/modules/esm/resolve:854:9) at moduleResolve (node:internal/modules/esm/resolve:927:18) at defaultResolve (node:internal/modules/esm/resolve:1169:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38) at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40) at link (node:internal/modules/esm/module_job:95:36) { code: 'ERR_MODULE_NOT_FOUND' }

eventually installed (The older version (0.1.0) worked.) but complained along the way: node: v20.18.2

@eastlondoner
Copy link
Owner

eastlondoner commented Feb 9, 2025

playwright is marked as a peer dependency so will not necessarily install when you install cursor-tools

IMO playwright is better installed globally than per package because it pulls in chromium and stuff.

To fix I believe you should npm install -g playwright - This is missing from the docs though!!

I am not an expert on this so if there's some expert guidance on the best way to add a playwright dependency I would love to see it

@atreib
Copy link
Contributor

atreib commented Feb 11, 2025

I faced some issues with playwright globally installed too. Personally, I'm installing and uninstalling cursor-tools to the project as dev dependency, and not pushing to my project's repos.

What if we move playwright as a dependency? Since it is required on install?
I think it would make the "onboarding" smoothier @eastlondoner

@eastlondoner
Copy link
Owner

@atreib thanks for the report, it’s useful for thinking about how this should change.

For you can you try removing cursor-tools from your project package.json? And installing the latest cursor@alpha globally with:

npm install -g cursor-tools@alpha

And see if that works more smoothly for you?

@atreib
Copy link
Contributor

atreib commented Feb 12, 2025

@eastlondoner

it did installed correctly and, after I ran npm i -g playwright, I can run all commands from the CLI like this:

cursor-tools [command]

and it works!

But when I try to use it inside of Composer, it generates the commands like this:

npx -y cursor-tools@latest [command]

Which fails due to playwright not found.

I can see in the CURSOR_RULES_TEMPLATE that the AI Agent uses the 2nd approach ("npx -y cursor-tools@latest [command]") when it "understands" that cursor-tools is not the "Installed version". So my guess is that AI Agent is not understanding what we mean with "Installed version".

IMO, we can:

  1. On install, check if playwright is available and, if not, ask the user to install it
  2. Drop the "Without installation" instruction from the template (I just tested that in my .cursorrules file and it works great)

I can do a PR with both pretty quickly, if you agree 🙂

@kjanoudi
Copy link
Contributor

I personally dropped the without install and it works better for me.

@eastlondoner
Copy link
Owner

@atreib it seems like local install works better for some people and global better for others. And for others particulary people who aren’t familiar with node, the “ephemeral” method where everything runs with npx is preferred)

I think what we need to do is figure out which installation people have (ephemeral, local or global) and set the .cursorrules prompts accordingly.

In the meantime you can as a workaround add “cursor tools is installed <globaly|locally|ephemeray> always run it using <just cursor-tools | npm exec | npx>” (delete as appropriate) to the top of your cursorrules before the cursor-tools section

@eastlondoner
Copy link
Owner

Adding fn a warning if playwright is not detected is definitely a good move.

On dropping the without instructions bit - if you think it’s a good idea put it in a PR so we know exactly what the change is then we can test and discuss it with a concrete example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants