Closed jbwl closed 1 year ago
Hey @jbwl , did you build the package before starting the app?
Yes, npm run build
but in the root of the library folder not in the example
folder.
Thank you, being a newbie, a lot of things are non-obvious to me. Keeping with the theme, I try to make it work without understanding what I'm doing:
Running in the root library folder:
❯ npm run build
> react-query-auth@2.0.0 build
> dts build
sh: dts: command not found
Ok, so I need "dts", whatever that is ;-)
❯ npm install dts
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: react-query-auth@2.0.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! dev react@"^18.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.9.0 || ^17.0.0" from @testing-library/react-hooks@8.0.1
npm ERR! node_modules/@testing-library/react-hooks
npm ERR! dev @testing-library/react-hooks@"^8.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/b/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/b/.npm/_logs/2023-01-10T09_52_28_995Z-debug-0.log
...so maybe I need to go to the example dir?
❯ cd example/
❯ npm install dts
added 228 packages, and audited 229 packages in 7s
46 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
phew, something did install...228 packages were needed... now I can surely build?
❯ cd ..
❯ npm run build
> react-query-auth@2.0.0 build
> dts build
sh: dts: command not found
still no dts found.
I know I'm being an annoying newbie here, please let me know if there are any basic things I need to have to get the example running.
Ok, here are the complete list of steps:
yarn install
or npm install
npm run build
or yarn build
example
yarn install
or npm install
npm start
or yarn start
That helped, the example is up and running. Thank you!
Just one more problem I was able to "fix" myself:
On your second step, npm install
needs --force
because of dependency errors.
One last general question: What would be a giveaway to an experienced JS developer that the library needs to be built before running? That's the step I wasn't aware had to do. I guess just by looking at the package.json's script section?
I'm trying to get the example app to start (Mac Ventura / NodeJS v16.19.0) and I'm getting the following error(s):
Steps taken:
Expected outcome: The example app should start without errors.
Actual outcome:
I'm not sure if my Node environment is the culprit? If so, any pointers how to fix it would be very appreciated. Thanks!