Cannot find module 'yargs' error while deploying node.js app to google cloud platform

user10742206 picture user10742206 · May 3, 2019 · Viewed 9.6k times · Source

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?

Answer

sina picture sina · Aug 16, 2019

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