
file:///usr/local/server/src/function/src/main.js:1 import { Client, ID ,Users} from 'node-appwrite'; ^^ SyntaxError: The requested module 'node-appwrite' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export. For example: import pkg from 'node-appwrite'; const { Client, ID ,Users} = pkg; at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21) at async ModuleJob.run (internal/modules/esm/module_job.js:137:5) at async Loader.import (internal/modules/esm/loader.js:162:24) at async execute (/usr/local/server/src/server.js:126:32) at async /usr/local/server/src/server.js:158:13

what version of appwrite are you on?

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.
Recommended threads
- Is Quick Start for function creation wor...
I am trying to create a Node.js function using the Quick Start feature. It fails and tells me that it could not locate the package.json file. Isn't Quick Start ...
- Connecting server functions to GitHub re...
The project I am working in has recently moved organizations on Appwrite. The same is true for the repo on GitHub, which as moved from a private user to a organ...
- Missing C++ libstdc library in Python fu...
I have a function running Python 3.12 which suddenly started dumping errors (as of today; it worked yesterday). I hadn't changed any code so I found this odd, b...
