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

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

Closed
m-ahmadi opened this issue Apr 9, 2017 · 14 comments · Fixed by renovatebot/renovate#216

Comments

@m-ahmadi
Copy link

m-ahmadi commented Apr 9, 2017

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

@nknapp
Copy link
Collaborator

nknapp commented Apr 10, 2017

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

nknapp commented May 10, 2017

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

@nknapp
Copy link
Collaborator

nknapp commented May 13, 2017

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.

@nknapp nknapp closed this as completed May 13, 2017
@m-ahmadi
Copy link
Author

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

@nknapp nknapp reopened this May 13, 2017
nknapp added a commit to nknapp/handlebars.js that referenced this issue May 13, 2017
Fixes handlebars-lang#1331

Due to the way, "bin"-files are distributed into the node_modules/.bin
directory on Windows, the task "test:cov" did not work on Windows.
This commit uses the node-script directly.
@nknapp
Copy link
Collaborator

nknapp commented May 13, 2017

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

nknapp added a commit to nknapp/handlebars.js that referenced this issue May 13, 2017
@nknapp
Copy link
Collaborator

nknapp commented May 13, 2017

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.

nknapp added a commit that referenced this issue May 14, 2017
@nknapp nknapp closed this as completed in 6e6269f May 14, 2017
@m-ahmadi
Copy link
Author

"remove the files in spec/artifacts and then do git reset --hard"

image

(I recloned and renpminstalled too, but still above err)

@nknapp
Copy link
Collaborator

nknapp commented May 14, 2017

This might be the last one... "*.hbs" files are also used as fixtures in the test and must have LF line-endings

@nknapp nknapp reopened this May 14, 2017
@nknapp
Copy link
Collaborator

nknapp commented May 14, 2017

I have only commited to the 4.x-branch now. Please try that one

@nknapp nknapp closed this as completed in ed879a6 May 14, 2017
@m-ahmadi
Copy link
Author

1

(same err in master and 4.x )

@nknapp
Copy link
Collaborator

nknapp commented May 15, 2017

mhm, didn't think about the spaces often occur in Windows directory names

@nknapp nknapp reopened this May 15, 2017
@nknapp
Copy link
Collaborator

nknapp commented May 15, 2017

I'll continue this in a separate branch. It doesn't make sense to merge to 4.x and master all the time without being sure that it works.

@nknapp
Copy link
Collaborator

nknapp commented Oct 13, 2017

There is now an appveyor-build (which runs on Windows machines) and successfully running all tests. I assume this issue can be closed. If you think that's not the case, please add a comment and I'll reopen.

@nknapp nknapp closed this as completed Oct 13, 2017
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

Successfully merging a pull request may close this issue.

2 participants