Closed nitrag closed 8 years ago
try var SNSPushAdatper = require('parse-server-sns-adapter')
Module issue?
var SNSPushAdapter = require('parse-server-sns-adapter');
/Users/ryan/Documents/Parse/parse-offroad-server/node_modules/parse-server-sns-adapter/src/SNSPushAdapter.js:5
const Parse = require('parse/node').Parse;
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/ryan/Documents/Parse/parse-offroad-server/node_modules/parse-server-sns-adapter/src/index.js:1:84)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
Add 'use strict' at the top of your file
Same error after adding strict to top of parse-server-example. The problem is SNSPushAdapter.js has "use strict" at the top. If I take "strict" out of both files I get another error:
/Users/ryan/Documents/Parse/parse-offroad-server/node_modules/parse-server-sns-adapter/src/SNSPushAdapter.js:24
let pushTypes = Object.keys(pushConfig.pushTypes);
^^^^^^^^^
SyntaxError: Unexpected identifier
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/ryan/Documents/Parse/parse-offroad-server/node_modules/parse-server-sns-adapter/src/index.js:1:84)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
@rogerhu
This should not be a problem, the tests pass properly on node 4.3, that means that 'use strict' should not be a problem. And SNSPushAdapter is supposed to have 'use strict' to use block scoped variables like let and const
What's your version of node? I suspect you use a version earlier than 4.3 therefore, that won't work. Please update to 4.3 or 4.4
I fixed the issue already..do another npm install of the module
Your 2nd issue @flovilmart thanks for pointing out
Fixed readme for import issud
So sorry, somehow was using wrong version of node. Thanks for your patience with my dumb self!
Added to packages.json, ran "npm install".