13

I am trying to deploy my node.js application to google cloud and my package.json includes the yargs as dependencies.

And when I deploy the app to google cloud and after that I am getting error can't find module yargs in google cloud platform logs.

How can I solve the above issue?

3 Answers 3

9

i had this problem too. all you need to do is installing 'yargs' locally by

npm init
npm i yargs --save

you can see the complete guide here

Sign up to request clarification or add additional context in comments.

Comments

0

While installing the yargs module, I encountered similar errors. I noticed that the type:module property was present in my "package.json" file. Removing this property resolved the issue, and my code started working as expected

Comments

0

This one worked for me

nvm install v18.12.0
nvm use v18.12.0

This will solve yargs error.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.