web-ifc-three icon indicating copy to clipboard operation
web-ifc-three copied to clipboard

Specify supported node version

Open TiberioG opened this issue 3 years ago • 2 comments

I tried to yarn build npm run build and got some errors cause I was using node v17.5.0 I tried with lts/gallium and everything went well. I could open a PR adding "engines" : { "node" : ">= 16.0.0 <17" } in the package.json or write it in the README.it But maybe it's better if you specify which are the node and npm versions that you know are ok.

Thanks !

TiberioG avatar May 04 '22 13:05 TiberioG

Hi! Hum, strange. Is there any breaking changes in node? Something we should do to make this compatible with future node versions?

agviegas avatar May 04 '22 18:05 agviegas

It was actually a problem with a rollup plugin

> [email protected] build
> rollup -c config/rollup.config.js && npm run build-declaration && npm run build-worker && npm run clean

Error loading `tslib` helper library.
[!] Error: Package subpath './package.json' is not defined by "exports" in /Users/tiberio/dev/ifcjs/web-ifc-three/node_modules/rollup-plugin-typescript2/node_modules/tslib/package.json
Error: Package subpath './package.json' is not defined by "exports" in /Users/tiberio/dev/ifcjs/web-ifc-three/node_modules/rollup-plugin-typescript2/node_modules/tslib/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:705:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/tiberio/dev/ifcjs/web-ifc-three/node_modules/rollup-plugin-typescript2/src/tslib.ts:11:23)

❯ npx envinfo --system OS  --binaries --npmPackages --npmGlobalPackages

  System:
    OS: macOS 12.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 307.95 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.5.0 - ~/.nvm/versions/node/v17.5.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v17.5.0/bin/yarn
    npm: 8.4.1 - ~/.nvm/versions/node/v17.5.0/bin/npm
  npmPackages:
    @rollup/plugin-node-resolve: ^11.2.0 => 11.2.1 
    web-ifc: ^0.0.33 => 0.0.33 
  npmGlobalPackages:
    corepack: 0.10.0
    cpy-cli: 4.1.0
    npm: 8.4.1
    rollup: 2.71.1
    yarn: 1.22.17

Whith LTS no issues, and as a matter of fact it shows a deprecation message for that plugin

❯ nvm use lts/gallium
Now using node v16.14.2 (npm v8.5.0)
❯ npx envinfo  --binaries --npmPackages --npmGlobalPackages

  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  npmPackages:
    @rollup/plugin-node-resolve: ^11.2.0 => 11.2.1 
    web-ifc: ^0.0.33 => 0.0.33 

❯ npm run build

> [email protected] build
> rollup -c config/rollup.config.js && npm run build-declaration && npm run build-worker && npm run clean

src/IFCLoader.ts → dist/IFCLoader.js...
src/IFCLoader.ts → dist/IFCLoader.js...
(node:6764) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/tiberio/dev/ifcjs/web-ifc-three/node_modules/rollup-plugin-typescript2/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".

TiberioG avatar May 04 '22 21:05 TiberioG