rrag / react-stockcharts-examples2

357 stars 122 forks source link

How to run those example? #1

Closed youngsol closed 7 years ago

youngsol commented 7 years ago

I am very new to npm and javascript. I have no background knowledge about installation and those framework. The below are the steps I did.

  1. npm install -g --save react-stockcharts@next
  2. git clone examples. (I went to CandleStickChart and ran index.html and did not see anything and I found that I have to install and run the script)
  3. go to directory of the example I want to run (CandleStickChart)
  4. npm install
  5. I got error message npm ERR! Linux 4.4.0-87-generic npm ERR! argv "node" "/usr/local/bin/npm" "install" npm ERR! node v0.10.25 npm ERR! npm v2.15.11 npm ERR! path /home/youngsol/react-stockcharts-examples2/examples/CandleStickStockScaleChart/node_modules/react-scripts/node_modules/babel-preset-react-app/node_modules/babel-plugin-transform-regenerator/node_modules/regenerator-transform/package.json npm ERR! code ENOENT npm ERR! errno 34

npm ERR! enoent ENOENT, open '/home/youngsol/react-stockcharts-examples2/examples/CandleStickStockScaleChart/node_modules/react-scripts/node_modules/babel-preset-react-app/node_modules/babel-plugin-transform-regenerator/node_modules/regenerator-transform/package.json' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent

  1. I tried to install regenerator-transform npm install -g regenerator-transform/ still no luck,

Please guide me. Thank you. ----EDIT --- I figured that step 1 is not necessary. I tried clone examples go to subdirectory, I ran npm i --save-dev still got same error. ---EDIT2 --- I removed everyhting installed globally and locally and re-installed. Still no luck. Even with example 1 repository. Thanks. ---EDIT3 --- I fixed my npm version and nodejs

npm ERR! peerinvalid The package eslint-plugin-jsx-a11y@5.0.1 does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer eslint-config-react-app@1.0.5 wants eslint-plugin-jsx-a11y@^5.0.3

still this error cannot fix anymore

rrag commented 7 years ago

sorry for the late reply

you have to use the right node version,

npm ERR! node v0.10.25
npm ERR! npm v2.15.11

0.10 is too old, and no longer supported. I recommend using 8.x

here is how it looks like for me

$ node -v
v8.1.2
$ npm -v
5.3.0

$ git clone https://github.com/rrag/react-stockcharts-examples2
$ cd examples/AreaChartWithZoomPan
$ npm install

there should not be any errors now, here is what I got

$ npm install
npm WARN react-stockcharts-example@0.0.24 No repository field.
npm WARN react-stockcharts-example@0.0.24 No license field.

added 1114 packages in 6.71s

after the npm install

$ npm start

this should launch a browser with http://localhost:3000

youngsol commented 7 years ago

Thank you for your kind reply. I found that npm version was the problem but I still got an error. My current node and npm versions are $node -v v8.4.0

$npm -v 5.3.0

npm install returns npm WARN react-stockcharts-example@0.0.24 No repository field. npm WARN react-stockcharts-example@0.0.24 No license field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.0.17 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm start Line 24: csvParse is not defined no-undef

I guess they don't support ubuntu 14.04? fsevent requires darwin which seems like Mac OS.

youngsol commented 7 years ago

$rm -rf node_modules/ && npm install && npm rebuild will fix the problem. But I still get ./src/utils.js Line 24: 'csvParse' is not defined no-undef

youngsol commented 7 years ago

Found it. It should be tsvParse. Also, I ran CandleStickChartForContinuosIntraDay. Again, In Line 24 csvParse need to be changed to tsvParse Thank you for your help. You can close this issue.

youngsol commented 7 years ago

I thought I fixed it but CandleStickChartForContinuosIntraDay. It only shows Loading text.. :( I confirmed AreaChartWithZoomPan example runs. What is the problem with CandleStickChartForContinuousIntraday?

rrag commented 7 years ago

I fixed the utils.js to include csvParse now please try again

youngsol commented 7 years ago

Thank you for your help. I will close this issue.