scope icon indicating copy to clipboard operation
scope copied to clipboard

Invoked setup function throws "Cannot find module 'sync-request'"

Open naiduarvind opened this issue 8 years ago • 7 comments

Tried to run sls invoke -f setup which threw this error despite having all the dependencies installed.

error

naiduarvind avatar Mar 11 '17 13:03 naiduarvind

In the backend folder

Run npm I sync-request again

It looks like that package is not in your nose modules or it is corrupted

Then deploy it again

  • David Wells

On Mar 11, 2017, at 5:13 AM, Arvind Naidu [email protected] wrote:

Tried to run sls invoke -f setup which threw this error despite having all the dependencies installed.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

DavidWells avatar Mar 11 '17 15:03 DavidWells

That was the first thing I did after cloning the repository as you can see below.

node_modules

Ran npm i sync-request again just like you asked and redeployed but the error still persists.

redeployed

Also updated my node and npm to the latest version just to eliminate that possibility.

naiduarvind avatar Mar 12 '17 04:03 naiduarvind

I'm having the same error, tried updating package.json to sync-request ^4.0.0, did not fix the problem.

mgd216 avatar Mar 31 '17 17:03 mgd216

Inside this folder https://github.com/serverless/scope/tree/master/backend make sure you run npm install then check the backend/node_modules folder for the sync-request module

DavidWells avatar Mar 31 '17 18:03 DavidWells

Thank you, I tried that same error. Nevertheless, very nice tutorial, thanks for your time.

mgd216 avatar Mar 31 '17 22:03 mgd216

@mgd216 do you have the sync-request module in your backend/node_modules folder?

If so, run sls deploy inside the backend folder to redeploy the service

DavidWells avatar Mar 31 '17 23:03 DavidWells

I was just getting the same error, had to match the node version in the serverless.yml file.

karsonenns avatar May 02 '17 04:05 karsonenns