esp8266-iot-framework icon indicating copy to clipboard operation
esp8266-iot-framework copied to clipboard

Error when run "npm ci"

Open loiiiic opened this issue 3 years ago • 1 comments

Hello,

I have just implemented your framework with the standard configuration and everything works perfectly. Thanks for the great work!

The next step for me is to customize the html file. For that, I did the following actions:

  • Installation of Node Version manager : curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

  • Installation of npm and node : nvm install node

  • Open a terminal in /xxx/.pio/libdeps/d1_mini/ESP8266 IoT Framework and run : npm ci

but I get this output :

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/react
npm ERR!   peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from [email protected]
npm ERR!   node_modules/mini-create-react-context
npm ERR!     mini-create-react-context@"^0.3.0" from [email protected]
npm ERR!     node_modules/react-router
npm ERR!       react-router@"5.1.2" from [email protected]
npm ERR!       node_modules/react-router-dom
npm ERR!         react-router-dom@"^5.1.2" from the root project
npm ERR!   peer react@"*" from [email protected]
npm ERR!   node_modules/react-icons
npm ERR!     react-icons@"^4.2.0" from the root project
npm ERR!   5 more (react-motion, react-router, react-router-dom, react-vis, styled-components)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-dom@">= 16.8.0" from [email protected]
npm ERR! node_modules/styled-components
npm ERR!   styled-components@"^5.1.0" from the root project
npm ERR!   peer styled-components@">= 2" from [email protected]
npm ERR!   node_modules/babel-plugin-styled-components
npm ERR!     dev babel-plugin-styled-components@"^1.10.7" from the root project
npm ERR!     1 more (styled-components)
npm ERR!   1 more (styled-normalize)
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"^18.1.0" from [email protected]
npm ERR!   node_modules/react-dom
npm ERR!     peer react-dom@">= 16.8.0" from [email protected]
npm ERR!     node_modules/styled-components
npm ERR!       styled-components@"^5.1.0" from the root project
npm ERR!       2 more (babel-plugin-styled-components, styled-normalize)
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 /home/loic/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/loic/.npm/_logs/2022-05-09T14_38_10_224Z-debug-0.log

Not being familiar with npm, but I guess it's a versioning issue between the packages associated with NPM on my computer and those requested by your framework. What is good practice in this case?

Thank you!

loiiiic avatar May 09 '22 15:05 loiiiic

Hello,

I have continued to investigate and can now run the npm ci command and npm run build.

To do this, I uninstalled the node.JS v18.1.0 version with : nvm uninstall v18.1.0

Then install the node.JS LTS version (16.15.0) with : nvm install --lts

loiiiic avatar May 12 '22 09:05 loiiiic

If you installed LTS on Windows10 and run into the same error, you can also try the following: npm ci --save --legacy-peer-deps You have to install legacy-peer-deps before.

Eisbaeeer avatar Sep 11 '22 19:09 Eisbaeeer

i do actually have the same issue where i am building a ci for a project i want to try out: https://github.com/ss89/Ferraris_MQTT_Energy_Counter_Meter_TCRT5000/actions/runs/3244592852/jobs/5320967950

I did switch from node 18 to node 16, but it doesn't seem to make a difference.

Any suggestions what to try? I actually want to contribute to your project with this @Eisbaeeer :-D

ss89 avatar Oct 13 '22 18:10 ss89

switching down to node 14 actually seemed to fix the issue. interesting.

ss89 avatar Oct 13 '22 18:10 ss89

I don't see a PR mentioned, how was this fixed?

ss89 avatar Nov 16 '22 05:11 ss89

@ss89 See 3a39b7ae3282e38cbc7f3f971e5c236c0d646e77

maakbaas avatar Nov 16 '22 08:11 maakbaas

Thank you 👍🏻

ss89 avatar Nov 16 '22 10:11 ss89