laardee / serverless-authentication-boilerplate

Generic authentication boilerplate for Serverless framework
http://laardee.github.io/serverless-authentication-gh-pages
MIT License
568 stars 71 forks source link

npm install FAIL at "mocha specs" (node 4.0 via nvm) #6

Closed lpanebr closed 8 years ago

lpanebr commented 8 years ago

I am running node 4.0 via nvm and got this: image

And here is the log file: npm-debug.log.tar.gz

Any idea?

laardee commented 8 years ago

At least there was couple dependencies missing from auth providers. Those were required in other package, so with npm 3.x this didn't occur.

In /authentication/package.json following packages should be upgraded to these versions

    "serverless-authentication-facebook": "^0.1.7",
    "serverless-authentication-google": "^0.1.8",
    "serverless-authentication-microsoft": "^0.1.7"

also in root folder's package.json there is extra dependecy

   "serverless-authentication": "^0.1.8",

that can be removed.

With these changes I got it working with node v.4.0.0 / npm v.2.14.2.

lpanebr commented 8 years ago

Will try it out later and report back.

Thanks

lpanebr commented 8 years ago

Now I get an error in step 6 when I run serverless function deploy:

$ serverless function deploy
/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:49
        fn = function () { throw arg; };
                           ^

ServerlessError: Could not parse JSON in file: /home/lpanebr/work/cubicus/aws-experiments/serverless-authentication-boilerplate/_meta/variables/s-variables-dev.json
    at new ServerlessError (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Error.js:17:11)
    at Object.module.exports.readFileSync (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/utils/index.js:197:15)
    at /home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Serializer.js:314:40
From previous event:
    at Stage.deserializeStage (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Serializer.js:306:27)
    at Stage.deserialize (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Serializer.js:26:57)
    at Stage.load (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Stage.js:26:19)
    at /home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Serializer.js:119:32
    at processImmediate [as _immediateCallback] (timers.js:371:17)
From previous event:
    at /home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Serializer.js:95:14
From previous event:
    at Project.deserializeProject (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Serializer.js:84:10)
    at Project.deserialize (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Serializer.js:26:57)
    at Project.load (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Project.js:35:19)
    at /home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Serverless.js:88:35
    at processImmediate [as _immediateCallback] (timers.js:371:17)
From previous event:
    at Serverless.init (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/lib/Serverless.js:80:10)
    at Object.<anonymous> (/home/lpanebr/.nvm/versions/node/v4.0.0/lib/node_modules/serverless/bin/serverless:17:12)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3

ideas please?

laardee commented 8 years ago

Can you check if your _meta/variables/s-variables-dev.json is valid, no commas or quotes missing.

laardee commented 8 years ago

@lpanebr, did you manage to get the functions deployed?

lpanebr commented 8 years ago

sorry for the delay.. It was indeed a missing comma!

Now I get the following warning.. but that is guess is just because I don't have microsoft credential I'll have to try editing the source and remove it..

Serverless: | Serverless: WARNING: This variable is not defined: providerMicrosoftId  
Serverless: WARNING: This variable is not defined: providerMicrosoftSecret  

I admit I am still freaking lost but thanks! hahaah

laardee commented 8 years ago

Yes, you need to remove unused environment variables from s-function.json files in authentication/authorize, authentication/callback and authentication/signin folders. You also have to edit the https://github.com/laardee/serverless-authentication-boilerplate/blob/master/authentication/lib/index.js for you needs. It is quite straight forward. I'll update the readme file little bit later to cover this also. I close this issue now, but I'll follow this thread if you have questions.