Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected token function #30

Closed
olivierperez opened this issue Jan 22, 2018 · 4 comments
Closed

SyntaxError: Unexpected token function #30

olivierperez opened this issue Jan 22, 2018 · 4 comments

Comments

@olivierperez
Copy link

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
Copy link
Author

Maybe it can help you, here is the Dockerfile

FROM node:6
RUN npm install -g daggraph
WORKDIR /source

@dvdciri
Copy link
Owner

dvdciri commented Jan 22, 2018

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
Copy link
Owner

dvdciri commented Jan 22, 2018

@dvdciri dvdciri closed this as completed Jan 22, 2018
@olivierperez
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants