sinak / democracy.io

democracy.io
GNU Affero General Public License v3.0
258 stars 57 forks source link

npm run build command throwing errors #111

Open ghost opened 7 years ago

ghost commented 7 years ago

I've cloned and I'm trying to get this application to run locally. I have installed Redis via homebrew and have it running and followed your documentation but when I run npm run build or gulp test I get an error:

npm run build

> democracy.io@1.0.2 build /Users/ME/democracy.io
> gulp build

#
# Fatal error in ../deps/v8/src/api.cc, line 1200
# Check failed: !value_obj->IsJSReceiver() || value_obj->IsTemplateInfo().
#

==== C stack trace ===============================

    0   node                                0x0000000100bf4433 v8::base::debug::StackTrace::StackTrace() + 19
    1   node                                0x0000000100bf15d9 V8_Fatal + 233
    2   node                                0x0000000100147b9a v8::Template::Set(v8::Local<v8::Name>, v8::Local<v8::Data>, v8::PropertyAttribute) + 330
    3   fse.node                            0x000000010228eb59 fse::FSEvents::Initialize(v8::Local<v8::Object>) + 197
    4   node                                0x0000000100a7aa01 node::DLOpen(v8::FunctionCallbackInfo<v8::Value> const&) + 888
    5   node                                0x000000010017b8c2 v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) + 466
    6   node                                0x00000001001e76ef v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 911
    7   node                                0x00000001001e6c49 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) + 281
    8   ???                                 0x0000154acc6040bd 0x0 + 23411000623293
    9   ???                                 0x0000154acca04974 0x0 + 23411004819828
Illegal instruction: 4

And if I go to view the app at 127.0.0.1:6379 and or localhost:6379 I get:

-ERR wrong number of arguments for 'get' command

Did I miss something during setup?

Thank you

ghost commented 7 years ago

Hello,

So the error above was being caused by multiple outdated packages and dependencies. I've since have updated the necessary packages.

I am now able to run: npm run test but get a timeout error:

raven@2.1.0 alert: no DSN provided, error reporting disabled

I also get errors when running npm run build:

Starting child process with 'node /Users/USER/democracy.io/server.js'
raven@2.1.0 alert: no DSN provided, error reporting disabled
TypeError: _.unique is not a function
    at getAllPathParamNames (/Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/path-parser.js:81:14)
    at registerPathParamMiddleware (/Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/path-parser.js:46:22)
    at pathParser (/Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/path-parser.js:27:5)
    at Middleware.parseRequest (/Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/middleware.js:143:15)
    at /Users/USER/democracy.io/server/app.js:53:22
    at /Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/middleware.js:67:9
    at /Users/USER/democracy.io/node_modules/call-me-maybe/index.js:11:28
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickDomainCallback (internal/process/next_tick.js:198:9)
    at Function.Module.runMain (module.js:607:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3
TypeError: _.unique is not a function
    at getAllPathParamNames (/Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/path-parser.js:81:14)
    at registerPathParamMiddleware (/Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/path-parser.js:46:22)
    at pathParser (/Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/path-parser.js:27:5)
    at Middleware.parseRequest (/Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/middleware.js:143:15)
    at /Users/USER/democracy.io/server/app.js:53:22
    at /Users/USER/democracy.io/node_modules/swagger-express-middleware/lib/middleware.js:67:9
    at /Users/USER/democracy.io/node_modules/call-me-maybe/index.js:11:28
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickDomainCallback (internal/process/next_tick.js:198:9)
    at Function.Module.runMain (module.js:607:11)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3
Program node /Users/USER/democracy.io/server.js exited with code 1
ghost commented 7 years ago

Is there a specific DSN that I'm supposed to be using?

I've gone to the Sentry site and created an account added my the DSN number from my account into the .env file and still getting errors:

Error: Invalid Sentry DSN: SENTRY_DSN
    at Object.parseDSN (/Users/USER/democracy.io/node_modules/raven/lib/utils.js:85:11)
    at Raven.config (/Users/USER/democracy.io/node_modules/raven/lib/client.js:45:22)
    at Object.<anonymous> (/Users/USER/democracy.io/server/raven-client.js:3:25)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/USER/democracy.io/server/app.js:25:13)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/USER/democracy.io/server.js:2:11)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3
Program node /Users/USER/democracy.io/server.js exited with code 1
ghost commented 7 years ago

So I've gotten a little further in my adventure in getting this thing to run locally. I finally have the site displaying but with the main address form not displaying due to another error:

Error: [$injector:modulerr] Failed to instantiate module democracyIoApp due to:
lockerProvider.setDefaultDriver is not a function
configureApp@http://localhost:7000/static/1.0.2/js/dio.min.js:77597:3
invoke@http://localhost:7000/static/1.0.2/js/dio.min.js:14091:16
runInvokeQueue@http://localhost:7000/static/1.0.2/js/dio.min.js:13978:11
loadModules/<@http://localhost:7000/static/1.0.2/js/dio.min.js:13988:11
forEach@http://localhost:7000/static/1.0.2/js/dio.min.js:9461:11
loadModules@http://localhost:7000/static/1.0.2/js/dio.min.js:13968:5
createInjector@http://localhost:7000/static/1.0.2/js/dio.min.js:13890:19
doBootstrap@http://localhost:7000/static/1.0.2/js/dio.min.js:11000:20
bootstrap@http://localhost:7000/static/1.0.2/js/dio.min.js:11021:12
@http://localhost:7000/:4:45
trigger@http://localhost:7000/static/1.0.2/js/dio.min.js:12519:5
wrapped@http://localhost:7000/static/1.0.2/js/dio.min.js:72297:24

Any suggestions would be greatly appreciated

sinak commented 7 years ago

Hi there! You've probably already tried this, but is angular-locker installed as a dependency? If so, which version do you have installed?

fv42wid commented 6 years ago

I know this is old, but for anyone coming across this the version of angular-locker you install must be prior to 2.0.

From 2.0 release notes - https://github.com/tymondesigns/angular-locker/releases/tag/2.0.0

Breaking Changes Changed the way config is set via lockerProvider e.g. lockerProvider.defaults({ driver: 'session', namespace: 'myApp', separator: '.', eventsEnabled: true, extend: {} });