dvdciri / daggraph

Dagger dependency graph generator for Android Developers
MIT License
1.15k stars 58 forks source link

SyntaxError: Unexpected token function #30

Closed olivierperez closed 6 years ago

olivierperez commented 6 years ago

Description

I've made a Docker image to use daggraph without need of npm or any installation (exept Docker of course).

But it failed with this error:

sync function findComponents(projectRootPath){
      ^^^^^^^^

SyntaxError: Unexpected token function
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/daggraph/src/router.js:7:25)

Steps to reproduce

Here is the command I execute in the root folder of my project:

docker run --rm -v $(pwd):/source olivierperez/daggraph daggraph app/src/

Basically it will execute daggraph app/src/ on my project.

Assumption

I don't use the right folder (in my example: app/src/)

olivierperez commented 6 years ago

Maybe it can help you, here is the Dockerfile

FROM node:6
RUN npm install -g daggraph
WORKDIR /source
dvdciri commented 6 years ago

Have you tried to update the node version? Could be a possible cause.

Also how are you handling the input prompted for the graph version type? The cli will ask you for the chart type you want to generate

dvdciri commented 6 years ago

Yeah, node version. https://stackoverflow.com/questions/37815790/syntaxerror-unexpected-token-function-async-await-nodejs Closing

olivierperez commented 6 years ago

Thanks, the image now use node:9. It works well 👍 docker run -it --rm -v $(pwd):/source olivierperez/daggraph daggraph .