drudge / passport-facebook-token

Passport strategy for authenticating with Facebook access tokens using the OAuth 2.0 API.
MIT License
390 stars 80 forks source link

Error: Cannot find module 'passport-facebook-token' When deploying on Azure #76

Open kasradzenika opened 7 years ago

kasradzenika commented 7 years ago

Background: in my package.json:

{
  ...
  "dependencies": {
    ...
    "passport": ">=0.3.2",
    "passport-jwt": ">=2.1.0",
    "passport-local": ">=1.0.0",
    "passport-facebook-token": "*",
    "nodemailer":"*"
  }
}

I just had to npm install on the local machine and everything worked as expected.

The Problem I have pushed to git repo which is deployed to my Azure App Service. I made a test request that automatically calls npm install --production and kicks off the server. Azure threw an error:

Application has thrown an uncaught exception and is terminated:
Error: Cannot find module 'passport-facebook-token'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    ...

After I manually ran npm install in the App Service Console it logged that passport-facebook-token was successfully installed. I retried the request and it worked!

So I thought it was a one-time issue. As I coded happily on and made another deployment the scenario repeated. And it keeps repeating.

Halp!