larksuite / node-sdk

larksuite open sdk for nodejs
MIT License
139 stars 29 forks source link

使用sdk 时报错,某些模块 Could not resolve? #100

Closed Aganivi closed 3 weeks ago

Aganivi commented 1 month ago

✘ [ERROR] Could not resolve "crypto"

node_modules/.pnpm/@larksuiteoapi+node-sdk@1.32.0/node_modules/@larksuiteoapi/node-sdk/es/index.js:15:19:
  15 │ import crypto from 'crypto';
     ╵                    ~~~~~~~~

The package "crypto" wasn't found on the file system but is built into node. Add "node_compat = true" to your wrangler.toml file and make sure to prefix the module name with "node:" to enable Node.js compatibility.

✘ [ERROR] Could not resolve "fs"

node_modules/.pnpm/@larksuiteoapi+node-sdk@1.32.0/node_modules/@larksuiteoapi/node-sdk/es/index.js:19:15:
  19 │ import fs from 'fs';
     ╵                ~~~~

The package "fs" wasn't found on the file system but is built into node. Add "node_compat = true" to your wrangler.toml file and make sure to prefix the module name with "node:" to enable Node.js compatibility.

✘ [ERROR] Could not resolve "querystring"

node_modules/.pnpm/@larksuiteoapi+node-sdk@1.32.0/node_modules/@larksuiteoapi/node-sdk/es/index.js:21:15:
  21 │ import qs from 'querystring';
     ╵                ~~~~~~~~~~~~~

The package "querystring" wasn't found on the file system but is built into node. Add "node_compat = true" to your wrangler.toml file and make sure to prefix the module name with "node:" to enable Node.js compatibility.

mazhe-nerd commented 4 weeks ago

这个sdk是运行在node环境的,不能用在别的环境