I've been working with Appwrite cloud functions, closely following the documentation. I successfully deployed a function, but when trying to execute it, I'm getting an error that says it can't find the 'node-appwrite' module. I used 'appwrite init' to create and 'appwrite deploy function' to deploy the functions. I also tried manual deployment with the same issue. My Appwrite version is 1.4.3. I've attached screenshots here and I could use any help from the community here.
Summary
User is having trouble with the 'node-appwrite' module not being found when trying to execute an Appwrite cloud function. They have tried deploying the function using both 'appwrite init' and manual deployment methods, but the issue persists. Their Appwrite version is 1.4.3. They are seeking help from the community. Solution: One suggestion is to try adding a "commands" key with the value of "npm install" in the appwrite.json file. Another suggestion is to try running "npm install" in the Build Command section either when uploading the function or from the Settings tab and then redeploying.
anyuru
Rank 2: Process
Oct 2, 2023, 09:21
Is there anyone to help me with this?
darShan
Oct 2, 2023, 09:26
Try npm install in the Build Command section either when uploading the function or from the Settings tab & Redeploy.
anyuru
Rank 2: Process
Oct 2, 2023, 09:29
I'm deploying using the cli. I cannot find where to do this.
darShan
Oct 2, 2023, 09:31
either on the Settings tab, or in the appwrite.json.
anyuru
Rank 2: Process
Oct 2, 2023, 09:33
That's the appwrite.json
anyuru
Rank 2: Process
Oct 2, 2023, 09:33
There is no command for building.
anyuru
Rank 2: Process
Oct 2, 2023, 09:34
In the settings tab. The only options that are customizable are the ones with github.
darShan
Oct 2, 2023, 09:35
I'm not sure of the key, but try by adding a "commands":"npm install".
anyuru
Rank 2: Process
Oct 2, 2023, 09:39
It's not the key
anyuru
Rank 2: Process
Oct 2, 2023, 09:40
I've tried deploying but still not working
darShan
Oct 2, 2023, 09:41
can you show the appwrite.json with the commands added?
anyuru
Rank 2: Process
Oct 2, 2023, 09:45
I had added it at function level
anyuru
Rank 2: Process
Oct 2, 2023, 09:45
I've also tried it at project level. It's bringing another error
darShan
Oct 2, 2023, 09:45
cli & appwrite version?
anyuru
Rank 2: Process
Oct 2, 2023, 09:46
appwrite version 1.4.3
anyuru
Rank 2: Process
Oct 2, 2023, 09:46
Cli version 2.0.2
darShan
Oct 2, 2023, 09:46
Update cli to 4.1.0 which supports appwrite 1.4.x.
darShan
Oct 2, 2023, 09:47
after that the commands key will be picked up by the cli.