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

pnpm install canvas successfully , but importing and requiring all lead to the result of ' can't find module ' #2423

Open
Super1Windcloud opened this issue Aug 25, 2024 · 0 comments

Comments

@Super1Windcloud
Copy link

A:\nvm_node_list\nodejs\node.exe --import tsx A:\Webstorm\awesome_example\pokerMagic\vue-demo\src\utils\poker.ts
A:\Webstorm\awesome_example\pokerMagic\vue-demo\src\utils
node:internal/modules/cjs/loader:1186
const err = new Error(message);
^

Error: Cannot find module '../build/Release/canvas.node'
Require stack:

  • A:\Webstorm\awesome_example\node_modules.pnpm\[email protected]\node_modules\canvas\lib\bindings.js
  • A:\Webstorm\awesome_example\node_modules.pnpm\[email protected]\node_modules\canvas\lib\canvas.js
  • A:\Webstorm\awesome_example\node_modules.pnpm\[email protected]\node_modules\canvas\index.js
  • A:\Webstorm\awesome_example\pokerMagic\vue-demo\src\utils\poker.ts
    at Module._resolveFilename (node:internal/modules/cjs/loader:1186:15)
    at m._resolveFilename (file:///A:/Webstorm/awesome_example/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/register-BArwRho-.mjs:1:789)
    at nextResolveSimple (A:\Webstorm\awesome_example\node_modules.pnpm\[email protected]\node_modules\tsx\dist\register-C1urN2EO.cjs:3:942)
    at A:\Webstorm\awesome_example\node_modules.pnpm\[email protected]\node_modules\tsx\dist\register-C1urN2EO.cjs:2:2486
    at A:\Webstorm\awesome_example\node_modules.pnpm\[email protected]\node_modules\tsx\dist\register-C1urN2EO.cjs:2:1560
    at resolveTsPaths (A:\Webstorm\awesome_example\node_modules.pnpm\[email protected]\node_modules\tsx\dist\register-C1urN2EO.cjs:3:760)
    at Function._resolveFilename (A:\Webstorm\awesome_example\node_modules.pnpm\[email protected]\node_modules\tsx\dist\register-C1urN2EO.cjs:3:1035)
    at Module._load (node:internal/modules/cjs/loader:1012:27)
    at Module.require (node:internal/modules/cjs/loader:1271:19)
    at require (node:internal/modules/helpers:123:16) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'A:\Webstorm\awesome_example\node_modules\.pnpm\[email protected]\node_modules\canvas\lib\bindings.js',
    'A:\Webstorm\awesome_example\node_modules\.pnpm\[email protected]\node_modules\canvas\lib\canvas.js',
    'A:\Webstorm\awesome_example\node_modules\.pnpm\[email protected]\node_modules\canvas\index.js',
    'A:\Webstorm\awesome_example\pokerMagic\vue-demo\src\utils\poker.ts'
    ]
    }

Node.js v22.2.0

进程已结束,退出代码为 1

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

1 participant