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

npm run build on Windows #445

Closed
aking7 opened this issue Nov 1, 2017 · 35 comments
Closed

npm run build on Windows #445

aking7 opened this issue Nov 1, 2017 · 35 comments
Assignees

Comments

@aking7
Copy link
Contributor

aking7 commented Nov 1, 2017

I'm getting errors on Windows 10 when trying to npm run build and node run-tests.

From npm run build in update-badges:

> ccxt@1.9.326 update-badges C:\Users\kinga\Documents\GitHub\ccxt
> node update-badges

Preparing for PyPI → ./python/README.rst (pipez.js:23)
C:\Users\kinga\Documents\GitHub\ccxt\update-badges.js:24
let rstExchangeTableLines = match[2].split ("\n")
                                 ^

TypeError: Cannot read property '2' of null
    at Object.<anonymous> (C:\Users\kinga\Documents\GitHub\ccxt\update-badges.js:24:34)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Function.Module.runMain (module.js:665:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ccxt@1.9.326 update-badges: `node update-badges`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ccxt@1.9.326 update-badges script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kinga\AppData\Roaming\npm-cache\_logs\2017-11-01T20_53_13_376Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ccxt@1.9.326 build: `npm run export-exchanges && npm run vss && npm run pandoc-python-readme && npm run pandoc-doc-readme && npm run pandoc-doc-manual && npm run pandoc-doc-install && npm run pandoc-doc-exchanges && npm run pandoc-doc-exchanges-by-country && npm run transpile && npm run update-badges && npm run browserify`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ccxt@1.9.326 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kinga\AppData\Roaming\npm-cache\_logs\2017-11-01T20_53_13_452Z-debug.log

From node run-tests:

C:\Users\kinga\Documents\GitHub\ccxt>node run-tests
Testing { exchanges: <array[90]>, symbol: "all", keys: { '--js': false, '--php': false, '--python': false, '--python3': false } } (pipez.js:23)
[Error] spawn python2 ENOENT

    at _errnoException        util.js:1021
    at onexit                 internal/child_process.js:192
    at onErrorNT              internal/child_process.js:374
    at _combinedTickCallback  internal/process/next_tick.js:138
    at _tickCallback          internal/process/next_tick.js:180   (pipez.js:23)
@munrocket
Copy link
Contributor

I have same problem with this regular expression in update-badges.js by processing README.rst.
In previous version of ccxt all was ok.

@kroitor kroitor self-assigned this Nov 1, 2017
@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

Thx for reporting, now looking into it.

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

Can you please paste the full sequence of commands that you use to build it?

I just did this:

git clone https://github.com/ccxt/ccxt.git
cd ccxt
npm install
npm run build

And it worked for me (I have pandoc, Python2 and 3 and all requirements from the CONTRIBUTING doc). Can you show full list of your commands + the output, plz?

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

Also, can you please paste your version of pandoc?

mbp:ccxt igorkroitor$ pandoc -v
pandoc 1.19.2.1
Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4
Default user data directory: /Users/igorkroitor/.pandoc
Copyright (C) 2006-2016 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
mbp:ccxt igorkroitor$ 

It should say 1.19+, not 1.12+.

@aking7
Copy link
Contributor Author

aking7 commented Nov 1, 2017

I'm running the same series of commands as you with the current pandoc.

C:\Users\kinga\Documents\GitHub\ccxt>pandoc -v
pandoc 1.19.2.1
Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4
Default user data directory: C:\Users\kinga\AppData\Roaming\pandoc
Copyright (C) 2006-2016 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@aking7 ok, can you please paste the python/README.rst file (somewhere) that it should have generated ?

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@aking7 also, can you please post the full build log of the above sequence of commands?

@aking7
Copy link
Contributor Author

aking7 commented Nov 1, 2017

@aking7
Copy link
Contributor Author

aking7 commented Nov 1, 2017


C:\Users\kinga\Documents\GitHub\ccxt>npm install
up to date in 2.772s

C:\Users\kinga\Documents\GitHub\ccxt>npm run build

> ccxt@1.9.326 build C:\Users\kinga\Documents\GitHub\ccxt
> npm run export-exchanges && npm run vss && npm run pandoc-python-readme && npm run pandoc-doc-readme && npm run pandoc-doc-manual && npm run pandoc-doc-install && npm run pandoc-doc-exchanges && npm run pandoc-doc-exchanges-by-country && npm run transpile && npm run update-badges && npm run browserify


> ccxt@1.9.326 export-exchanges C:\Users\kinga\Documents\GitHub\ccxt
> node export-exchanges

Exporting exchanges → ./ccxt.js (pipez.js:23)
Exporting exchanges → ./python/ccxt/__init__.py (pipez.js:23)
Exporting exchanges → ./python/ccxt/__init__.py (pipez.js:23)
Exporting exchanges → ./python/ccxt/async/__init__.py (pipez.js:23)
Exporting exchanges → ./python/ccxt/async/__init__.py (pipez.js:23)
Exporting exchanges → ./php/base/Exchange.php (pipez.js:23)
Exporting exchanges → ./ccxt.php (pipez.js:23)
Base sources updated successfully. (pipez.js:23)
Exporting exchanges to README.md ... (pipez.js:23)
Exporting exchanges to ccxt.wiki/Manual.md ... (pipez.js:23)
Exporting exchanges to ccxt.wiki/Exchange-Markets.md ... (pipez.js:23)
Exporting exchange ids to exchanges.json (pipez.js:23)
Exchanges exported successfully. (pipez.js:23)

> ccxt@1.9.326 vss C:\Users\kinga\Documents\GitHub\ccxt
> node vss

Old version:  1.9.326 (pipez.js:23)
New version:  1.9.326 (pipez.js:23)
Single-sourcing version 1.9.326 ./package.json → ./ccxt.php (pipez.js:23)
Single-sourcing version 1.9.326 ./package.json → ./ccxt.js (pipez.js:23)
Single-sourcing version 1.9.326 ./package.json → ./python/ccxt/__init__.py (pipez.js:23)
Single-sourcing version 1.9.326 ./package.json → ./python/ccxt/async/__init__.py (pipez.js:23)
Single-sourcing version 1.9.326 ./package.json → ./python/ccxt/base/exchange.py (pipez.js:23)
Single-sourcing version 1.9.326 ./package.json → ./python/ccxt/async/base/exchange.py (pipez.js:23)
Version single-sourced successfully. (pipez.js:23)

> ccxt@1.9.326 pandoc-python-readme C:\Users\kinga\Documents\GitHub\ccxt
> pandoc --wrap=preserve --columns=10000 --from=markdown --to=rst --output=python/README.rst README.md


> ccxt@1.9.326 pandoc-doc-readme C:\Users\kinga\Documents\GitHub\ccxt
> pandoc --wrap=preserve --columns=10000 --from=markdown --to=rst --output=doc/README.rst README.md


> ccxt@1.9.326 pandoc-doc-manual C:\Users\kinga\Documents\GitHub\ccxt
> pandoc --wrap=preserve --columns=10000 --from=markdown --to=rst --output=doc/manual.rst ccxt.wiki/Manual.md


> ccxt@1.9.326 pandoc-doc-install C:\Users\kinga\Documents\GitHub\ccxt
> pandoc --wrap=preserve --columns=10000 --from=markdown --to=rst --output=doc/install.rst ccxt.wiki/Install.md


> ccxt@1.9.326 pandoc-doc-exchanges C:\Users\kinga\Documents\GitHub\ccxt
> pandoc --wrap=preserve --columns=10000 --from=markdown --to=rst --output=doc/exchanges.rst ccxt.wiki/Exchange-Markets.md


> ccxt@1.9.326 pandoc-doc-exchanges-by-country C:\Users\kinga\Documents\GitHub\ccxt
> pandoc --wrap=preserve --columns=10000 --from=markdown --to=rst --output=doc/exchanges-by-country.rst ccxt.wiki/Exchange-Markets-By-Country.md


> ccxt@1.9.326 transpile C:\Users\kinga\Documents\GitHub\ccxt
> node transpile

Transpiling from acx.js (pipez.js:23)
Transpiling from allcoin.js (pipez.js:23)
Transpiling from anxpro.js (pipez.js:23)
Transpiling from binance.js (pipez.js:23)
Transpiling from bit2c.js (pipez.js:23)
Transpiling from bitbay.js (pipez.js:23)
Transpiling from bitcoincoid.js (pipez.js:23)
Transpiling from bitfinex.js (pipez.js:23)
Transpiling from bitfinex2.js (pipez.js:23)
Transpiling from bitflyer.js (pipez.js:23)
Transpiling from bithumb.js (pipez.js:23)
Transpiling from bitlish.js (pipez.js:23)
Transpiling from bitmarket.js (pipez.js:23)
Transpiling from bitmex.js (pipez.js:23)
Transpiling from bitso.js (pipez.js:23)
Transpiling from bitstamp.js (pipez.js:23)
Transpiling from bitstamp1.js (pipez.js:23)
Transpiling from bittrex.js (pipez.js:23)
Transpiling from bl3p.js (pipez.js:23)
Transpiling from bleutrade.js (pipez.js:23)
Transpiling from btcbox.js (pipez.js:23)
Transpiling from btcchina.js (pipez.js:23)
Transpiling from btcexchange.js (pipez.js:23)
Transpiling from btcmarkets.js (pipez.js:23)
Transpiling from btctradeua.js (pipez.js:23)
Transpiling from btcturk.js (pipez.js:23)
Transpiling from btcx.js (pipez.js:23)
Transpiling from bter.js (pipez.js:23)
Transpiling from bxinth.js (pipez.js:23)
Transpiling from ccex.js (pipez.js:23)
Transpiling from cex.js (pipez.js:23)
Transpiling from chbtc.js (pipez.js:23)
Transpiling from chilebit.js (pipez.js:23)
Transpiling from coincheck.js (pipez.js:23)
Transpiling from coinfloor.js (pipez.js:23)
Transpiling from coingi.js (pipez.js:23)
Transpiling from coinmarketcap.js (pipez.js:23)
Transpiling from coinmate.js (pipez.js:23)
Transpiling from coinsecure.js (pipez.js:23)
Transpiling from coinspot.js (pipez.js:23)
Transpiling from cryptopia.js (pipez.js:23)
Transpiling from dsx.js (pipez.js:23)
Transpiling from exmo.js (pipez.js:23)
Transpiling from flowbtc.js (pipez.js:23)
Transpiling from foxbit.js (pipez.js:23)
Transpiling from fybse.js (pipez.js:23)
Transpiling from fybsg.js (pipez.js:23)
Transpiling from gatecoin.js (pipez.js:23)
Transpiling from gateio.js (pipez.js:23)
Transpiling from gdax.js (pipez.js:23)
Transpiling from gemini.js (pipez.js:23)
Transpiling from hitbtc.js (pipez.js:23)
Transpiling from hitbtc2.js (pipez.js:23)
Transpiling from huobi.js (pipez.js:23)
Transpiling from huobicny.js (pipez.js:23)
Transpiling from huobipro.js (pipez.js:23)
Transpiling from independentreserve.js (pipez.js:23)
Transpiling from itbit.js (pipez.js:23)
Transpiling from jubi.js (pipez.js:23)
Transpiling from kraken.js (pipez.js:23)
Transpiling from kuna.js (pipez.js:23)
Transpiling from lakebtc.js (pipez.js:23)
Transpiling from liqui.js (pipez.js:23)
Transpiling from livecoin.js (pipez.js:23)
Transpiling from luno.js (pipez.js:23)
Transpiling from mercado.js (pipez.js:23)
Transpiling from mixcoins.js (pipez.js:23)
Transpiling from nova.js (pipez.js:23)
Transpiling from okcoincny.js (pipez.js:23)
Transpiling from okcoinusd.js (pipez.js:23)
Transpiling from okex.js (pipez.js:23)
Transpiling from paymium.js (pipez.js:23)
Transpiling from poloniex.js (pipez.js:23)
Transpiling from qryptos.js (pipez.js:23)
Transpiling from quadrigacx.js (pipez.js:23)
Transpiling from quoine.js (pipez.js:23)
Transpiling from southxchange.js (pipez.js:23)
Transpiling from surbitcoin.js (pipez.js:23)
Transpiling from therock.js (pipez.js:23)
Transpiling from tidex.js (pipez.js:23)
Transpiling from urdubit.js (pipez.js:23)
Transpiling from vaultoro.js (pipez.js:23)
Transpiling from vbtc.js (pipez.js:23)
Transpiling from virwox.js (pipez.js:23)
Transpiling from wex.js (pipez.js:23)
Transpiling from xbtce.js (pipez.js:23)
Transpiling from yobit.js (pipez.js:23)
Transpiling from yunbi.js (pipez.js:23)
Transpiling from zaif.js (pipez.js:23)
Transpiling from _1broker.js (pipez.js:23)
Transpiling from _1btcxe.js (pipez.js:23)
Transpiling ./python/test/test_async.py → ./python/test/test.py (pipez.js:23)
Transpiled successfully. (pipez.js:23)

> ccxt@1.9.326 update-badges C:\Users\kinga\Documents\GitHub\ccxt
> node update-badges

Preparing for PyPI → ./python/README.rst (pipez.js:23)
C:\Users\kinga\Documents\GitHub\ccxt\update-badges.js:24
let rstExchangeTableLines = match[2].split ("\n")
                                 ^

TypeError: Cannot read property '2' of null
    at Object.<anonymous> (C:\Users\kinga\Documents\GitHub\ccxt\update-badges.js:24:34)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Function.Module.runMain (module.js:665:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ccxt@1.9.326 update-badges: `node update-badges`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ccxt@1.9.326 update-badges script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kinga\AppData\Roaming\npm-cache\_logs\2017-11-01T22_27_05_033Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ccxt@1.9.326 build: `npm run export-exchanges && npm run vss && npm run pandoc-python-readme && npm run pandoc-doc-readme && npm run pandoc-doc-manual && npm run pandoc-doc-install && npm run pandoc-doc-exchanges && npm run pandoc-doc-exchanges-by-country && npm run transpile && npm run update-badges && npm run browserify`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ccxt@1.9.326 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kinga\AppData\Roaming\npm-cache\_logs\2017-11-01T22_27_05_114Z-debug.log

C:\Users\kinga\Documents\GitHub\ccxt>

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

Ok, I will install windows 10 to see why update-badges complains...

As for the node run-tests, it says python2 is missing on your system. You should either run js+python3 tests only:

node run-tests --js --python3

or you should install python2 on your system to run with --python as well.

@aking7
Copy link
Contributor Author

aking7 commented Nov 1, 2017

I have both Python 2 & 3 installed :/

C:\Users\kinga\Documents\GitHub\ccxt>node run-tests --js --python3
Testing { exchanges: <array[90]>, symbol: "all", keys: { '--js': true, '--php': false, '--python': false, '--python3': true } } (pipez.js:23)
[Error] spawn python3 ENOENT

    at _errnoException        util.js:1021
    at onexit                 internal/child_process.js:192
    at onErrorNT              internal/child_process.js:374
    at _combinedTickCallback  internal/process/next_tick.js:138
    at _tickCallback          internal/process/next_tick.js:180   (pipez.js:23)

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@aking7 can you launch python2 or python3 from your command line?

@aking7
Copy link
Contributor Author

aking7 commented Nov 1, 2017

Yes, but I am using Anaconda. Perhaps that has something to do with it?

C:\Users\kinga\Documents\GitHub\ccxt>python
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
C:\Users\kinga\Documents\GitHub\ccxt>activate py27

(py27) C:\Users\kinga\Documents\GitHub\ccxt>python
Python 2.7.14 |Anaconda, Inc.| (default, Oct 15 2017, 03:34:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

No, I mean, literally, python2 command or python3 command. The run-tests.js launches them like that. So, if you don't have python2 or python3 on your system, it won't find the Anaconda, because Anaconda switches the version of python binary, and does not install them both in parallel. We will have to fix for that in order to make Windows builds pass.

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@aking7 you can also launch the run-tests without python at all, like so:
node run-tests --js
↑ does this work for you?

Also, can you please tell your version of node? Thx for your responses!

kroitor added a commit that referenced this issue Nov 1, 2017
kroitor added a commit that referenced this issue Nov 1, 2017
kroitor added a commit that referenced this issue Nov 1, 2017
@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

I uploaded a few minor fixes for it, can you please update the repo with git pull and try launching:

node run-tests --js --python

?

@aking7
Copy link
Contributor Author

aking7 commented Nov 1, 2017

node run-tests --js runs fine. Trying the new version now.

@aking7
Copy link
Contributor Author

aking7 commented Nov 1, 2017

Some exchange errors but node run-tests --js --python is all good now! Still no luck with npm run build.

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@aking7 cool, thx for your responsiveness and for the assistance! I'm digging into the windows build now.

@kroitor
Copy link
Member

kroitor commented Nov 1, 2017

@aking7 can you tell your Node version?

@aking7
Copy link
Contributor Author

aking7 commented Nov 1, 2017

C:\Users\kinga\Documents\GitHub\ccxt>node -v
v8.7.0

C:\Users\kinga\Documents\GitHub\ccxt>npm -v
5.5.1

@kroitor Calling it a night now, but can get back to you in the morning with more info.

@kroitor kroitor changed the title Build and run-tests problems on Windows npm run build on Windows Nov 2, 2017
@kroitor
Copy link
Member

kroitor commented Nov 2, 2017

@aking7 when you installed git for Windows, which of these options did you choose?

screen shot 2017-11-02 at 06 54 56

@kroitor
Copy link
Member

kroitor commented Nov 2, 2017

I reproduced the bug with the first option from the above screen selected on a Windows virtual machine. So, I guess it's a CRLF vs regex [\n] conflict of Windows vs. the rest of the world... But don't worry, if this is the case, I'll fix it shortly.

@kroitor kroitor closed this as completed in 5d18c72 Nov 2, 2017
@kroitor
Copy link
Member

kroitor commented Nov 2, 2017

This issue was fixed in 1.9.335. Thx to you, @aking7 and @munrocket !

@munrocket
Copy link
Contributor

munrocket commented Nov 2, 2017

CRLF vs regex [\n]

Lol, thanks.

@aking7
Copy link
Contributor Author

aking7 commented Nov 2, 2017

You're great @kroitor ! Working like a charm now. Oh the beauty of cross-platform projects :)

@aking7
Copy link
Contributor Author

aking7 commented Nov 2, 2017

@kroitor Seems there's one more issue. npm run build is fine but node run-tests --python does not pass. Looks like there is a problem with __init__.py after the transpile. Here is the file and my command window output: https://gist.github.com/aking7/5626fc76b69a0f24f6d862f183289dd0

@kroitor
Copy link
Member

kroitor commented Nov 2, 2017

@aking7 yeah, must be a minor leftover in another script. Will fix it as well shortly. Thx!

kroitor added a commit that referenced this issue Nov 2, 2017
@kroitor
Copy link
Member

kroitor commented Nov 2, 2017

Ok, check out master again, this should be fixed completely now. Thx again for reporting!

@aking7
Copy link
Contributor Author

aking7 commented Nov 2, 2017

@kroitor Looks good! Always impressed by how quick you are!!

@talatabao
Copy link

I have bug

'cp' is not recognized as an internal or external command,
operable program or batch file.

and after run cmd: 'node run-tests --js ' is fail: [1%] Testing mixcoins FAIL (testExchange @ run-tests.js:152) ............

pls help for me, Thanks All!

@kroitor
Copy link
Member

kroitor commented Apr 19, 2018

@talatabao will get to it and fill fix it, hopefuly, soon. I'll let you know when the fix for it is available...

@talatabao
Copy link

Hi kroitor,

I have fix problems,
error 'cp' i installed cygwin to compile on windown.
Everything seems very good when running 'npm run build' does not generate errors.
But when running 'run-tests --js node', bad things happen.
it fails.

Thanks kroitor!
---------------------- image capture bug ------------------------------
image

@kroitor
Copy link
Member

kroitor commented Apr 19, 2018

But when running 'run-tests --js node', bad things happen.

You should not run run-tests --js node you should run node run-tests --js )) I guess, it's just a typo.

As for the cause: when all of them are failing, there's most likely some simple reason, like a missing module or something. Try running a test for one exchange to see the detailed cause of the failure:

npm run build 
node js/test/test bittrex

↑ That should show the cause of failures. After fixing it, the other failures should go away as well, and the node run-tests --js should pass. Let us know if it does not help.

@talatabao
Copy link

Hi kroitor,

I'm very happy to receive your help!

you should run node run-tests --js )) I guess, it's just a typo.

Yes, it's just a typo. ^_^ I has running node run-tests --js

I triead running it again as per your instruction:

npm run build
node js/test/test bittrex

It good, it passed the old bug.

But i see new bug, I attach images capture.

image

Please help me, Thanks Kroitor!

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

4 participants