Closed UnHumbleBen closed 4 years ago
Why did you add yard add react-svg-pan-zom
to the README.md in examples ? the library is already specified in package.json and the instructions for running the examples that are in the README.md are correct the way they are
How strange, when I run yarn install, the react-svg-pan-zoom library is in my node modules but the app can’t import it. It’s not till I run yarn add react-svg-pan-zoom that it works.
On Sun, Dec 8, 2019 at 1:23 AM Adam Wolski notifications@github.com wrote:
Why did you add yard add react-svg-pan-zom to the README.md in examples ? the library is already specified in package.json and the instructions for running the examples that are in the README.md are correct the way they are
— You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/chrvadala/react-svg-pan-zoom/pull/166?email_source=notifications&email_token=AHOOY7YSI5SFLQBKLFZGN6TQXS4HTA5CNFSM4JTNDZZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGGZNYQ#issuecomment-562927330, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHOOY77O7A4XBVEBAKKL6TTQXS4HTANCNFSM4JTNDZZQ .
Did you build the library beforehand? Run npm run build
before running the example app. Since it impots local library, not the published one on npm
When I run npm run build
in the root directory of this repo, I get
> react-svg-pan-zoom@3.6.0 build react-svg-pan-zoom
> run-p clean library:build:commonjs library:build:es library:build:umd library:build:umd_min storybook:build
sh: 1: run-p: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! react-svg-pan-zoom@3.6.0 build: `run-p clean library:build:commonjs library:build:es library:build:umd library:build:umd_min storybook:build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the react-svg-pan-zoom@3.6.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ben/.npm/_logs/2019-12-10T02_49_04_277Z-debug.log
If I run it inside of example directory, (lets say the controlled-component-advanced-usage)
> controlled-component-adv@0.0.0 build /learning-examples/react-svg-pan-zoom/examples/controlled-component-advanced-usage
> react-scripts build
Creating an optimized production build...
Failed to compile.
./src/App.js
Cannot find module: 'react-svg-pan-zoom'. Make sure this package is installed.
You can install this package by running: yarn add react-svg-pan-zoom.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! controlled-component-adv@0.0.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the controlled-component-adv@0.0.0 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! /home/ben/.npm/_logs/2019-12-10T02_48_38_769Z-debug.log
I am not too familiar with npm. How do I properly build the library?
You have to run ‚npm install’, and then build the library, sorry i was not precise
On Tue, 10 Dec 2019 at 03:52, Benjamin Lee notifications@github.com wrote:
When I run npm run build in the root directory of this repo, I get
react-svg-pan-zoom@3.6.0 build react-svg-pan-zoom run-p clean library:build:commonjs library:build:es library:build:umd library:build:umd_min storybook:build sh: 1: run-p: not foundnpm ERR! file shnpm ERR! code ELIFECYCLEnpm ERR! errno ENOENTnpm ERR! syscall spawnnpm ERR! react-svg-pan-zoom@3.6.0 build:
run-p clean library:build:commonjs library:build:es library:build:umd library:build:umd_min storybook:build
npm ERR! spawn ENOENTnpm ERR! npm ERR! Failed at the react-svg-pan-zoom@3.6.0 build script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm WARN Local package.json exists, but node_modules missing, did you mean to install? npm ERR! A complete log of this run can be found in:npm ERR! /home/ben/.npm/_logs/2019-12-10T02_49_04_277Z-debug.logIf I run it inside of example directory, (lets say the controlled-component-advanced-usage)
controlled-component-adv@0.0.0 build /learning-examples/react-svg-pan-zoom/examples/controlled-component-advanced-usage react-scripts build
Creating an optimized production build... Failed to compile.
./src/App.js Cannot find module: 'react-svg-pan-zoom'. Make sure this package is installed.
You can install this package by running: yarn add react-svg-pan-zoom.
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! controlled-component-adv@0.0.0 build:
react-scripts build
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the controlled-component-adv@0.0.0 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! /home/ben/.npm/_logs/2019-12-10T02_48_38_769Z-debug.log
I am not too familiar with npm. How do I properly build the library?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/chrvadala/react-svg-pan-zoom/pull/166?email_source=notifications&email_token=AALUMTBVUY25LPJGSZSTZNLQX376FA5CNFSM4JTNDZZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGMHRJY#issuecomment-563640487, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALUMTB23I765ZY3DYMQK6LQX376FANCNFSM4JTNDZZQ .
Thanks! Its working now! Can you explain how exactly these commands work? I always thought that yarn and npm were interchangable. Is there a reason why I need to build and install with npm, but serve with yarn?
Oh no, they are interchangable. I am just used to npm so I wrote that you need to run npm
:)
On 10 December 2019 at 09:24:50, Benjamin Lee (notifications@github.com) wrote:
Thanks! Its working now! Can you explain how exactly these commands work? I always thought that yarn and npm were interchangable. Is there a reason why I need to build and install with npm, but serve with yarn?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
I see, so perhaps the README should include yarn build command right after yarn install?
On Tue, Dec 10, 2019 at 12:51 AM Adam Wolski notifications@github.com wrote:
Oh no, they are interchangable. I am just used to npm so I wrote that you need to run
npm
:)On 10 December 2019 at 09:24:50, Benjamin Lee (notifications@github.com) wrote:
Thanks! Its working now! Can you explain how exactly these commands work? I always thought that yarn and npm were interchangable. Is there a reason why I need to build and install with npm, but serve with yarn?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
— You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/chrvadala/react-svg-pan-zoom/pull/166?email_source=notifications&email_token=AHOOY73RIXUWWXXVE3EKEBDQX5KCPA5CNFSM4JTNDZZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGOOP5Q#issuecomment-563931126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHOOY7ZWABTB6HLDHESYC6TQX5KCPANCNFSM4JTNDZZQ .
I see, so perhaps the README should include yarn build command right after yarn install?
Well, the thing is that the README in the examples assumes that you have already built the library. I think it should include a step called "Build a library" and link to the README of the library where is well described how to do it
There doesn't seem to be a README for how to build the library yet.
You're right, I think we should add the instructions
Okay I added a build.md file to the docs.
Released with 3.7.1 I added @UnHumbleBen in contributors list
Coverage increased (+16.9%) to 38.981% when pulling 80b1e876fa022125d5c3a060d726ed3aa00e754a on UnHumbleBen:patch-1 into 9a9930be28533df867bbc0f2e4759d881972ad8a on chrvadala:master.