getappmap / appmap-agent-js

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

AppMap Agent: Error: Cannot find module '../build/Release/canvas.node' #238

Open iPoetDev opened 1 year ago

iPoetDev commented 1 year ago

On run of installer, after afresh reinstall of PyCharm 2023.2 (or a run of Webstorm) on Windows 10 | npm 9.6.7 | node 20.3.0

Step: to install the AppMap agent, I get


C:\Users\%USER%\AppData\Local\JetBrains\appland-plugin\appmap\3.82.1\appmap-win-x64.exe install -d "D:\Code\Code Institute\PP4_masterclass"
pkg/prelude/bootstrap.js:1876
      throw error;
      ^

Error: Cannot find module '../build/Release/canvas.node'
Require stack:
- D:\Code\node_modules\canvas\lib\bindings.js
- D:\Code\node_modules\canvas\lib\canvas.js
- D:\Code\node_modules\canvas\index.js
- C:\snapshot\appmap-js\node_modules\jsdom\lib\jsdom\utils.js
- C:\snapshot\appmap-js\node_modules\jsdom\lib\jsdom\living\events\MouseEvent-impl.j
s
- C:\snapshot\appmap-js\node_modules\jsdom\lib\jsdom\living\generated\MouseEvent.js
- C:\snapshot\appmap-js\node_modules\jsdom\lib\jsdom\living\events\EventTarget-impl.
js
- C:\snapshot\appmap-js\node_modules\jsdom\lib\jsdom\living\generated\EventTarget.js

- C:\snapshot\appmap-js\node_modules\jsdom\lib\jsdom\living\interfaces.js
- C:\snapshot\appmap-js\node_modules\jsdom\lib\jsdom\browser\Window.js
- C:\snapshot\appmap-js\node_modules\jsdom\lib\api.js
- C:\snapshot\appmap-js\packages\cli\built\cmds\agentInstaller\mavenInstaller.js
- C:\snapshot\appmap-js\packages\cli\built\cmds\agentInstaller\installers.js
- C:\snapshot\appmap-js\packages\cli\built\cmds\agentInstaller\install-agent.js
- C:\snapshot\appmap-js\packages\cli\built\cli.js

1) If you want to compile the package/file into executable, please pay attention to
compilation warnings and specify a literal in 'require' call. 
2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem
(likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.

?[90m    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:1
5)?[39m
    at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46)
?[90m    at Function.Module._load (node:internal/modules/cjs/loader:778:27)?[39m
?[90m    at Module.require (node:internal/modules/cjs/loader:1005:19)?[39m
    at Module.require (pkg/prelude/bootstrap.js:1855:31)
    at Module.patchedRequire [as require] (C:\snapshot\appmap-js\node_modules\?[4mdi
agnostic-channel?[24m\dist\src\patchRequire.js:16:46)
?[90m    at require (node:internal/modules/cjs/helpers:102:18)?[39m
    at Object.<anonymous> (D:\Code\node_modules\?[4mcanvas?[24m\lib\bindings.js:3:18
)
?[90m    at Module._compile (node:internal/modules/cjs/loader:1105:14)?[39m
    at Module._compile (pkg/prelude/bootstrap.js:1894:32) {
  code: ?[32m'MODULE_NOT_FOUND'?[39m,
  requireStack: [
    ?[32m'D:\\Code\\node_modules\\canvas\\lib\\bindings.js'?[39m,
    ?[32m'D:\\Code\\node_modules\\canvas\\lib\\canvas.js'?[39m,
    ?[32m'D:\\Code\\node_modules\\canvas\\index.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\node_modules\\jsdom\\lib\\jsdom\\utils.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\node_modules\\jsdom\\lib\\jsdom\\living\\events\\
MouseEvent-impl.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\node_modules\\jsdom\\lib\\jsdom\\living\\generate
d\\MouseEvent.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\node_modules\\jsdom\\lib\\jsdom\\living\\events\\
EventTarget-impl.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\node_modules\\jsdom\\lib\\jsdom\\living\\generate
d\\EventTarget.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\node_modules\\jsdom\\lib\\jsdom\\living\\interfac
es.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\node_modules\\jsdom\\lib\\jsdom\\browser\\Window.
js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\node_modules\\jsdom\\lib\\api.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\packages\\cli\\built\\cmds\\agentInstaller\\maven
Installer.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\packages\\cli\\built\\cmds\\agentInstaller\\insta
llers.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\packages\\cli\\built\\cmds\\agentInstaller\\insta
ll-agent.js'?[39m,
    ?[32m'C:\\snapshot\\appmap-js\\packages\\cli\\built\\cli.js'?[39m
  ],
  pkg: ?[33mtrue?[39m
}

Process finished with exit code 1

I have tried to NPM install (local|globally) canvas and still get the same error

iPoetDev commented 1 year ago

Also following the extension instructions,

PowerShell 7.3.6
PS D:\Code\Code Institute\PP4_masterclass> npm install --save-dev appmap-agent-js
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/appmap-agent-js - Not found
npm ERR! 404 
npm ERR! 404  'appmap-agent-js@*' is not in this registry.
npm ERR! 404 
npm ERR! 404 Note that you can also install from a 
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: C:\Users\%USER%\AppData\Local\npm-cache\_logs\2023-07-27T12_33_06_201Z-debug-0.log
PS D:\Code\Code Institute\PP4_masterclass> yarn add --dev appmap-agent-js
yarn add v1.22.19
warning ..\..\package.json: No license field       
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. 
It is advised not to mix package managers in order 
to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove
 package-lock.json.
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/appmap-agent-js: Not found".        
info If you think this is a bug, please open a bug 
report with the information provided in "D:\\Code\\Code Institute\\PP4_masterclass\\yarn-error.log".  
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
PS D:\Code\Code Institute\PP4_masterclass> 
iPoetDev commented 1 year ago

Message to G Hamlin

I have a @latest version systems patching process that keeps all my dependencies at the latest on Windows (I use WinGetUI, and it updates regularly), so can level up all my programs' systems wide for security and consistency.

So, I will need some support about setting up a side-by-side Node 18 and Node 20 config (does it work like Java and discern which version?) as I would hesitate to downgrade to an older variant and the break my other dependencies that are tuned for Node 20.

If you have a beta version for Node 20, that is another approach for me, so don't have to downgrade a system-wide install,