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 Error on windows machines #72

Closed
ByungkwonJeon opened this issue Feb 22, 2017 · 14 comments
Closed

Build Error on windows machines #72

ByungkwonJeon opened this issue Feb 22, 2017 · 14 comments

Comments

@ByungkwonJeon
Copy link

Hi There,

Could you please help me what problem is? I can't build this.

C:\workspace\parmica_new\braintree-web-drop-in>npm run build

braintree-web-drop-in@1.0.0-beta.4 build J:\workspace\parmica_new\braintree-web-drop-in
gulp build

[10:31:18] Using gulpfile J:\workspace\parmica_new\braintree-web-drop-in\gulpfile.js
[10:31:18] Starting 'build'...
[10:31:18] Starting 'clean'...
[10:31:18] Finished 'clean' after 4.39 ms
[10:31:18] Starting 'build:js:unmin'...
[10:31:18] Starting 'build:js:min'...
[10:31:18] Starting 'build:css'...
[10:31:18] Starting 'build:jsdoc'...
events.js:160
throw er; // Unhandled 'error' event
^

Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

npm ERR! Windows_NT 10.0.14393

Thanks,

@lilaconlee
Copy link
Contributor

Thank you for reporting this! We'll take a look at these build issues as we get out of beta and have more time to make sure the project is easy to work on for external devs.

If you're not looking to contribute to braintree-web-drop-in, you can include the already built file in your project with a script tag like this:

  <script src="https://js.braintreegateway.com/web/dropin/1.0.0-beta.4/js/dropin.min.js"></script>

Drop-in will also be available to include via npm in the near future.

@crookedneighbor
Copy link
Contributor

crookedneighbor commented Feb 22, 2017

I was able to reproduce the build error on a windows machine. For me, it errors when trying to symlink.

Looks like this is the offending line:

fs.symlink(VERSION, 'dist/web/dropin/dev', done);

Strange that the fs module is doing something that windows doesn't like.

@EvanHahn
Copy link
Contributor

It looks like Node has some issues with symlinking on Windows.

@crookedneighbor crookedneighbor changed the title Build Error Build Error on windows machines Mar 7, 2017
@juongithub
Copy link
Contributor

Actually the error you are reporting means that, on Windows, npm cannot find bash (that is a Linux command). I suggest to edit gulpfile.js and to change the line:

spawn('bash', ['-c', args.join(' ')], { [...]

with lines:

var command = 'bash', opt = '-c';
  if (process.platform.indexOf('win')>=0) {
      command = 'cmd';
      opt = '/c';
  }
  spawn(command, [opt, args.join(' ')], { [...]

@crookedneighbor
Copy link
Contributor

@juongithub Do you want to open a PR?

@juongithub
Copy link
Contributor

Yes, I'm opening a PR

@juongithub
Copy link
Contributor

Ok, I'm not able to open a PR... any advice?

@crookedneighbor
Copy link
Contributor

What do you mean that you aren't able to open a PR?

@juongithub
Copy link
Contributor

I'm not familiar to github, I'm not able to commit the new file.

@crookedneighbor
Copy link
Contributor

Here is the Github help article for creating a pull request: https://help.github.com/articles/creating-a-pull-request/

@crookedneighbor
Copy link
Contributor

You will first need to fork the repo so you have your own copy of the repo on Github. https://help.github.com/articles/fork-a-repo/

@crookedneighbor
Copy link
Contributor

I will try out your change later today or tomorrow, but if you'd like to still open a PR before I get to it, feel free.

@juongithub
Copy link
Contributor

Just created a PR, thanks :)

@crookedneighbor
Copy link
Contributor

The symlink error I posted earlier was because you need to run the command prompt as an administrator when on windows. I'll update the docs to indicate this.

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

5 participants