user10742206
user10742206

Reputation:

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

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?

Upvotes: 13

Views: 25554

Answers (3)

jibril90
jibril90

Reputation: 99

This one worked for me

nvm install v18.12.0
nvm use v18.12.0

This will solve yargs error.

Upvotes: 0

gourav lalotra
gourav lalotra

Reputation: 1

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

Upvotes: 0

Sina Abedi
Sina Abedi

Reputation: 2401

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

Upvotes: 9

Related Questions