soundboard icon indicating copy to clipboard operation
soundboard copied to clipboard

How Build From Source On Nodejs 20.12.2 - Possible Fixes

Open jangaza opened this issue 1 year ago • 1 comments

This is a possible fix for anyone having same issues with building from source as me:

  1. ERR_PACKAGE_PATH_NOT_EXPORTED error
PS C:\Users\\soundboard> yarn build
yarn run v1.22.19
warning ..\..\..\..\..\..\..\..\..\..\package.json: No license field
$ react-scripts build && yarn compile
node:internal/modules/cjs/loader:597
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in C:\Users\\soundboard\node_modules\postcss-safe-parser\node_modules\postcss\package.json
    at exportsNotFound (node:internal/modules/esm/resolve:304:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:651:9)
    at resolveExports (node:internal/modules/cjs/loader:590:36)
    at Module._findPath (node:internal/modules/cjs/loader:667:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1129:27)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (C:\Users\\soundboard\node_modules\postcss-safe-parser\lib\safe-parser.js:1:17)
    at Module._compile (node:internal/modules/cjs/loader:1369:14) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
  1. ERR_OSSL_EVP_UNSUPPORTED error

  2. After successfully running all commands in README: Untitled

Step-by-step how to fix these errors (some of then are not nessesery!):

install newest nodejs and yarn open powershell git clone https://github.com/LoredCast/soundboard.git cd soundboard open package.json and remove all ^ in "dependencies" and "devDependencies" yarn policies set-version 1.22.19 $env:NODE_OPTIONS="--openssl-legacy-provider" yarn install $env:NODE_OPTIONS="--openssl-legacy-provider" yarn build - error delete node_modules and yarn.lock yarn install yarn build yarn electron-build and should work now!

I have no idea what exactly fixed it, but this is summary of my tinkering around.

jangaza avatar Apr 27 '24 18:04 jangaza

This has to do with the fact that this app uses an old node version (16), newer node versions have a different ssl api and will not build this project. Thank you for your fix! This app needs to be substantially updated in the future though!

LoredCast avatar Apr 21 '25 15:04 LoredCast