getappmap / appmap-agent-js

This project is deprecated. Please use https://github.com/getappmap/appmap-node/ to record Node.js applications.
Other
28 stars 8 forks source link

`appmap-agent-js` cannot be run without first being installed to a project #133

Open dustinbyrne opened 2 years ago

dustinbyrne commented 2 years ago

To recreate, run npx @appland/appmap-agent-js from a directory that does not contain a Node project, e.g. the home directory:

$ npx @appland/appmap-agent-js
could not resolve ["@appland","appmap-agent-js"] from "file:///home/db/" >> Error: Cannot find module '@appland/appmap-agent-js'
Require stack:
- /home/db/dummy.js

This looks suspiciously like: https://github.com/getappmap/appmap-agent-js/blob/main/components/setup/node/index.mjs#L125-L129

Requiring ourselves by name will fail unless the name is resolvable (and presumably isn't outside of a Node project).

lachrist commented 2 years ago

https://github.com/getappmap/appmap-agent-js/commit/3257c2587e66fb118053eb11a2e11f161003ee7e