streamlit-component-template-react-hooks icon indicating copy to clipboard operation
streamlit-component-template-react-hooks copied to clipboard

Dependency issues when Trying to npm install

Open mch-weevaa opened this issue 1 year ago • 1 comments
trafficstars

When just trying to install NPM packages I get this error:

my_component\frontend> npm install npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/typescript npm ERR! dev typescript@"^4.6.2" from the root project npm ERR! peer typescript@">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" from [email protected] npm ERR! node_modules/tsutils npm ERR! tsutils@"^3.17.1" from @typescript-eslint/[email protected] npm ERR! node_modules/@typescript-eslint/eslint-plugin npm ERR! peer @typescript-eslint/eslint-plugin@"2.x" from [email protected] npm ERR! node_modules/eslint-config-react-app npm ERR! eslint-config-react-app@"^5.2.1" from [email protected] npm ERR! node_modules/react-scripts npm ERR! 1 more (react-scripts) npm ERR! tsutils@"^3.17.1" from @typescript-eslint/[email protected] npm ERR! node_modules/@typescript-eslint/typescript-estree npm ERR! @typescript-eslint/typescript-estree@"2.34.0" from @typescript-eslint/[email protected] npm ERR! node_modules/@typescript-eslint/experimental-utils 34.0 34.0 34.0 npm ERR! node_modules/@typescript-eslint/eslint-plugin npm ERR! 1 more (@typescript-eslint/parser) npm ERR! 1 more (@typescript-eslint/parser) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional typescript@"^3.2.1" from [email protected] npm ERR! node_modules/react-scripts npm ERR! react-scripts@"3.4.1" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/typescript npm ERR! peerOptional typescript@"^3.2.1" from [email protected] npm ERR! node_modules/react-scripts npm ERR! react-scripts@"3.4.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.

mch-weevaa avatar Dec 19 '23 13:12 mch-weevaa

This is more of a workaround rather than a fix but you can try using nvm and make sure you're using node version 16. Then delete the node_module folder and package-lock.json re-run npm install making sure you're using node version 16 and you should be all set to go!

McDonnellJoseph avatar Jan 08 '24 10:01 McDonnellJoseph