Skip to content

Build fails, Running "test:cov" task failed: SyntaxError: missing ) after argument list in node_modules\.bin\istanbul:2  #1331

Closed
renovatebot/renovate
#216
@m-ahmadi

Description

@m-ahmadi

I'm on windows.
I followed instructions in CONTRIBUTING.md.
I did both of the following, separately and both have failed.
First I did:

git clone https://github.com/wycats/handlebars.js.git
git submodule update --init
npm install
grunt

then I did

git clone https://github.com/wycats/handlebars.js.git --recursive
npm install
grunt

After both of the above this happened:

E:\xampp\htdocs\handlebars.js\node_modules\.bin\istanbul:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list

hb

It's weird because there is no test:cov in the Gruntfile.js

Activity

nknapp

nknapp commented on Apr 10, 2017

@nknapp
Collaborator

Looks like Grunt is calling a bash-script for. In my checkout (on Linux) node_modules/.bin/istanbul is not a bash script, but a JavaScript file.

nknapp

nknapp commented on May 10, 2017

@nknapp
Collaborator

Could you remove the "node_modules"-directory and re-run "npm install"?

nknapp

nknapp commented on May 13, 2017

@nknapp
Collaborator

Please add a comment if this problem is not solved for you. I'd like to cleanup a little and close requests that are probably answered.

m-ahmadi

m-ahmadi commented on May 13, 2017

@m-ahmadi
Author

"remove the node_modules directory and re-run npm install"
I just did that and nothing changed, still the same error.

reopened this on May 13, 2017
added a commit that references this issue on May 13, 2017
611d6d5
nknapp

nknapp commented on May 13, 2017

@nknapp
Collaborator

Could you apply the change I have commited in 611d6d5 and then run "grunt" again?

On Linux, all scripts in the "bin"-property of package.json are copied into the "node_modules"-directory.
On Windows, a ".cmd"-file and as bash-script is created instead. "grunt" runs istanbul with the "child_process.fork()"-command, which does not work with bash-scripts.
The commit directly uses the node-script instead.

m-ahmadi

m-ahmadi commented on May 13, 2017

@m-ahmadi
Author

"apply the change in commit: 611d6d5 and then run grunt"

Running "test:bin" task

Running "test:cov" task
Running env: ./runtime

460 passing (2s)
  26 pending
  2 failing

untitled

added a commit that references this issue on May 13, 2017
5c28efb
nknapp

nknapp commented on May 13, 2017

@nknapp
Collaborator

I think that the file spec/artifacts/example_1.handlebars contains CRLF line-endings in your checkout
I have updated the branch issue-1331 to fix this with a .gitattributes-file.
I could only make this work, by removing the files (i.e. the files in spec/artifacts) and then do git reset --hard to recreate the files.

The gitattributes-entry *.handlebars text eol=lf makes sure that the handlebars-files always have LF line-endings after checkout.

added 2 commits that reference this issue on May 14, 2017
6e6269f
b50ef03

13 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @nknapp@m-ahmadi

      Issue actions

        Build fails, Running "test:cov" task failed: SyntaxError: missing ) after argument list in node_modules\.bin\istanbul:2 · Issue #1331 · handlebars-lang/handlebars.js