toji / gl-matrix

Javascript Matrix and Vector library for High Performance WebGL apps
glmatrix.net
MIT License
5.37k stars 721 forks source link

npm run build-dts fails with "Cannot find name 'Iterable'" #426

Closed kirevdokimov closed 3 years ago

kirevdokimov commented 3 years ago

gl-matrix@3.3.0

> npm run build-dts
> tsc --allowJs --declaration --emitDeclarationOnly --module amd --outFile ./dist/index.d.ts ./src/index.js ./src/types.d.ts && node ./utils/bundle-dts.js && tsc --noEmit ./dist/index.d.ts

src/types.d.ts:1:37 - error TS2304: Cannot find name 'Iterable'.

1 interface IndexedCollection extends Iterable<number> {
                                      ~~~~~~~~

Found 1 error.
kirevdokimov commented 3 years ago

Judging by this stackoverflow answer npm install @types/node --save-dev can save the day, but this dependency dont have mention in package.json

Also installing @types/node make project unhappy:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: gl-matrix@3.3.0
npm ERR! Found: rollup@2.46.0
npm ERR! node_modules/rollup
npm ERR!   dev rollup@"^2.3.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rollup@"^1.20.0" from rollup-plugin-size-snapshot@0.11.0
npm ERR! node_modules/rollup-plugin-size-snapshot
npm ERR!   dev rollup-plugin-size-snapshot@"^0.11.0" 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 install @types/node --save-dev -f do it's job. After that npm run build-dts works just fine

kirevdokimov commented 3 years ago

Ok that big log throws even with simple npm install

kirevdokimov commented 3 years ago

My bad, forgot to call npm install before run. @types/node already included as a dependency for del-cli

> npm ls @types/node   
gl-matrix@3.3.0 /mnt/c/Project/fork/gl-matrix
└─┬ del-cli@3.0.1
  └─┬ del@5.1.0
    └─┬ globby@10.0.2
      └─┬ @types/glob@7.1.3
        └── @types/node@15.0.1