Back

[SOLVED] New Functions (node-18.0) Cannot Find package node-appwrite

  • 0
  • Functions
  • Cloud
ZachHandley
28 Sep, 2023, 21:54

and then deployed it, but it could never find Appwrite

TL;DR
User had an error with the new Functions (node-18.0) package not being able to find the node-appwrite package. They upgraded to version 4.1.0 using NPM instead of Homebrew and still got an error saying "Error: Unexpected 'G'" after a certain amount of time. Another user recommended not using Homebrew and suggested installing using NPM. The user also mentioned the outdated logo and that they upgraded it suspecting that as the issue. They checked the version of the CLI, appwrite -v, and mentioned that they deployed it but Appwrite couldn't be found. Solution: Install the
ZachHandley
28 Sep, 2023, 21:54

I was unaware there were build commands

Drake
28 Sep, 2023, 21:56

what version of the CLI are you using? appwrite -v

ZachHandley
28 Sep, 2023, 21:57

I actually upgrade it suspecting that, it said 4.0 was available but I ran brew upgrade appwrite and it seemed to install but didn't seem to change anything, lemme check 2.0.2

ZachHandley
28 Sep, 2023, 21:57

which is pretty oudated I take it?

ZachHandley
28 Sep, 2023, 21:58

also I love the new logo

Drake
28 Sep, 2023, 21:59

i don't recommend using brew...there is probably a bug. i recommend installing using NPM

ZachHandley
29 Sep, 2023, 00:39

copy

ZachHandley
29 Sep, 2023, 04:39

so after upgrading using NPM (and uninstalling homebrew one) I keep getting an error when I try to do anything after like, 30-45s that just says, "Error: Unexpected 'G'"

ZachHandley
29 Sep, 2023, 04:40
ZachHandley
29 Sep, 2023, 04:40
ZachHandley
29 Sep, 2023, 04:41

4.1.0 now

ZachHandley
29 Sep, 2023, 04:44
Drake
29 Sep, 2023, 06:09

Were you connecting to cloud?

ZachHandley
29 Sep, 2023, 06:14

yes

ZachHandley
29 Sep, 2023, 20:14

@Steven still getting weird errors in Appwrite

ZachHandley
29 Sep, 2023, 20:15
ZachHandley
29 Sep, 2023, 20:15
ZachHandley
29 Sep, 2023, 20:16
TypeScript
export default async ({ req, res, log, error }) => {
  // Why not try the Appwrite SDK?
  //
  const client = new Client()
    .setEndpoint('https://cloud.appwrite.io/v1')
    .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID)
    .setKey(process.env.APPWRITE_API_KEY);
  
  const database = new Databases(client);
  log("Hello, Logs!");
  error("Hello, Errors!");
  // The `req` object contains the request data
    // `res.json()` sends a JSON object back to the client
  try {
    log("Request Body: ", JSON.stringify(req.body));
    const user = await database.getDocument("maindb", "members", req.body);
    return res.json(user);
  } catch (error) {
    error(`Error Caught: ${JSON.stringify(error)}`);
    return res.json({ error: error.message });
  }

};
ZachHandley
29 Sep, 2023, 20:17

oh

ZachHandley
29 Sep, 2023, 20:17

duh

Drake
29 Sep, 2023, 23:41

was this a function from before 1.4?

Drake
29 Sep, 2023, 23:42

oh right error is being overridden

ZachHandley
30 Sep, 2023, 03:26

yeah I'll make it solved

ZachHandley
30 Sep, 2023, 03:26

[SOLVED] New Functions (node-18.0) Cannot Find package node-appwrite

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more