tabler / tabler-icons

A set of over 5700 free MIT-licensed high-quality SVG icons for you to use in your web projects.
https://tabler.io/icons
MIT License
18.21k stars 911 forks source link

build-iconfont/npm --install fails with npm error. #209

Closed Nothorse closed 1 year ago

Nothorse commented 2 years ago

I'm trying to build an iconfont with a stroke-width of 1, but I can't run "npm run build-iconfont". When I try to run npm --install I get the following error

`npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: @tabler/icons@1.54.0 npm ERR! Found: rollup@2.28.2 npm ERR! node_modules/rollup npm ERR! dev rollup@"2.28.2" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer rollup@">=0.66.0 <2" from rollup-plugin-uglify@6.0.4 npm ERR! node_modules/rollup-plugin-uglify npm ERR! dev rollup-plugin-uglify@"6.0.4" 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 /home/vagrant/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2022-03-01T15_19_26_731Z-debug-0.log `

I'm not a node expert, so I'm clueless. is this a bug? Am I doing something wrong?

eresolve-report.txt .

FreexD commented 2 years ago

Hi @Nothorse! what is your npm & node version?

ColinCampbell commented 2 years ago

I'm getting a similar error on a fresh fork of the repo as of today.

❯ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @tabler/icons@1.60.0
npm ERR! Found: rollup@2.70.1
npm ERR! node_modules/rollup
npm ERR!   dev rollup@"2.70.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer rollup@">=0.66.0 <2" from rollup-plugin-uglify@6.0.4
npm ERR! node_modules/rollup-plugin-uglify
npm ERR!   dev rollup-plugin-uglify@"6.0.4" 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/colinc/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/colinc/.npm/_logs/2022-04-03T00_40_48_579Z-debug-0.log

Node is v17.8.0 and npm is 8.5.5

Nothorse commented 2 years ago

Node is v17.6.0, npm is 8.5.1

I found time to search around and the fix seems to be to remove rollup-plugin-uglify and only use terser. I've tried it and so far it works for generating fonts. I can't say anything about other tasks.

remove-uglify.patch.zip

FreexD commented 2 years ago

@Nothorse nice workaround :) I guess that node 17 should not be supported with currently used packages/package versions. I think we should add engines field to package.json so that npm informs you whether the package is supported in your node version or not. Another step would be to add node 17 & higher support :) @Nothorse do you want to contribute a PR with a solution to this issue? :)

Nothorse commented 2 years ago

Sorry, I'm entirely clueless about node. I've attached the patch I used to get it working, which I basically found by googling furiously :)

So no, I can't offer anything beyond that little patch above. Sorry.