sony / nmos-js

An NMOS (Networked Media Open Specifications) Client in Javascript (IS-04, IS-05)
Apache License 2.0
32 stars 18 forks source link

Node.js v18.x build error #83

Open rhastie opened 2 years ago

rhastie commented 2 years ago

I'm currently using Node.js v16 LTS for production but testing Node.js v18. I am seeing build errors under Node.js v18.x... Any suggestions welcome?

[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.3.1: The platform "linux" is incompatible with this module.
info "fsevents@2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "react-admin > connected-react-router@6.8.0" has unmet peer dependency "immutable@^3.8.1 || ^4.0.0-rc.1".
warning "react-admin > connected-react-router@6.8.0" has unmet peer dependency "history@^4.7.2".
warning "react-admin > connected-react-router@6.8.0" has incorrect peer dependency "react@^16.4.0".
warning "react-admin > connected-react-router@6.8.0" has unmet peer dependency "seamless-immutable@^7.1.3".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 129.12s.
yarn run v1.22.15
$ react-scripts build
node:internal/modules/cjs/loader:489
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /home/nmos-js/Development/node_modules/postcss-safe-parser/node_modules/postcss/package.json
    at new NodeError (node:internal/errors:372:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:719:3)
    at resolveExports (node:internal/modules/cjs/loader:483:36)
    at Module._findPath (node:internal/modules/cjs/loader:523:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:925:27)
    at Module._load (node:internal/modules/cjs/loader:780:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/nmos-js/Development/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v18.0.0
error Command failed with exit code 1.
garethsb commented 2 years ago

https://github.com/postcss/postcss-safe-parser/issues/29

peterbrightwell commented 1 year ago

@rhastie @garethsb did you get this working? The postcss issue suggested npm install postcss but that's not working for me with Node 19.

peterbrightwell commented 1 year ago

Nor with node.js v18.12.1, using corepack and yarn (and yarn add postcss)

peterbrightwell commented 1 year ago

In the meantime I've downgraded to node v16.18.1 (with corepack 0.14.1 and yarn 3.2.4) and yarn start runs.

(Mac users: uninstalling node that was installed using the installer is hard work, I'd recommend Homebrew :) )

garethsb commented 11 months ago

Hey, @jonathan-r-thorpe, any thoughts on supporting Node v18+ ?

rhastie commented 11 months ago

So I've just checked the same issue is happening with Node v20.x as well. Is there anything we can do as it potentially just looks like a new syntax issue with later versions of Node

jonathan-r-thorpe commented 11 months ago

@garethsb in the short term pragmatically updating incompatible library versions just enough to mitigate this issue, but not so much that it requires a complete overhaul of the codebase. I'll schedule some time next week to take a look.