Gmousse / dataframe-js

No Maintenance Intended
https://gmousse.gitbooks.io/dataframe-js/
MIT License
460 stars 38 forks source link

NPM scripts don't work on windows os #82

Closed mbkupfer closed 5 years ago

mbkupfer commented 5 years ago

Describe the bug NPM scripts are not compatible on a windows scripts for two reasons:

  1. Use of single quotes
  2. Setting of environment variables

These have both been mitigated in my PR that I will submit. That said, I'm not sure if this is a complete fix as npm run test keeps failing due to an error with XMLHttpRequest regarding the tests involving DataFrame.fromXXXX. The error I get is below.

At the same time, I feel that this might not be related to the issue at hand, because when I remove the offending lines, the tests (and all other scripts) work just fine. This might just be an issue with my machine. Let me know your thoughts.

Unhandled rejection in tests\dataframeIO.test.js

C:\Users\mkupfer\dataframe-js\node_modules\xmlhttprequest\lib\XMLHttpRequest.js:299

Error: Protocol not supported.

Desktop (please complete the following information):

mbkupfer commented 5 years ago

83

Gmousse commented 5 years ago

@mbkupfer That's a good point !

mbkupfer commented 5 years ago

Also just noticed that rm and mkdir is not supported on windows. There are a couple solutions out there: I found that shx works fine.

mbkupfer commented 5 years ago

@Gmousse I figured out the final piece to the puzzle! The reason that the XMLHttpRequest error was because the protocol file:// was not being added for windows paths. Adding the path.startsWith("C") to file protocol will finally put this issue to rest :raised_hands:

Gmousse commented 5 years ago

Your PR #83 is now merged on develop.

It will be included in the next release.