edrlab / thorium-reader

A cross platform desktop reading app, based on the Readium Desktop toolkit
https://www.edrlab.org/software/thorium-reader/
BSD 3-Clause "New" or "Revised" License
1.81k stars 154 forks source link

Could this repo utilize `pnpm` for restoring node packages? #2132

Closed sgalcheung closed 5 months ago

sgalcheung commented 5 months ago

First, I use pnpm install to restore the node packages in this repository. Then, I run the build with npm run build, but I encountered some syntax issues.

EDRLab.ThoriumReader@3.0.0-alpha.1 build cross-env NODE_ENV=production webpack --config webpack.config.js && ncp src/package.json dist/package.json PREPROCESSOR nodeEnv: production MAIN nodeEnv: production WEBPACK externals (MAIN): -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { "bindings": "bindings", "fsevents": "fsevents", "electron-devtools-installer": "electron-devtools-installer", "remote-redux-devtools": "remote-redux-devtools", "electron": "electron", "yargs": "yargs" } LIBRARY nodeEnv: production WEBPACK externals (LIBRARY): -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { "bindings": "bindings", "fsevents": "fsevents", "electron-devtools-installer": "electron-devtools-installer", "remote-redux-devtools": "remote-redux-devtools", "electron": "electron", "yargs": "yargs" } READER nodeEnv: production WEBPACK externals (READER): -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { "bindings": "bindings", "fsevents": "fsevents", "electron-devtools-installer": "electron-devtools-installer", "remote-redux-devtools": "remote-redux-devtools", "electron": "electron", "yargs": "yargs" } PDF nodeEnv: production WEBPACK externals (PDF): -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- { "bindings": "bindings", "fsevents": "fsevents", "electron-devtools-installer": "electron-devtools-installer", "remote-redux-devtools": "remote-redux-devtools", "electron": "electron", "yargs": "yargs" } PRELOAD nodeEnv: production [webpack-cli] ModuleNotFoundError: Module not found: Error: Can't resolve 'urijs' in '/Users/ ...... at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errno: -32, code: 'EPIPE', syscall: 'write' } Error: write EPIPE at target._send (node:internal/child_process:879:20) at target.send (node:internal/child_process:752:19) ...... at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errno: -32, code: 'EPIPE', syscall: 'write'

}

sgalcheung commented 5 months ago

I'll walk through the steps to resolve this issue, summarizing the need to add a package.

pnpm add urijs --save-dev
pnpm add tslib --save-dev
pnpm add moment --save-dev
pnpm add slugify --save-dev
pnpm add tough-cookie --save-dev
pnpm add @types/tough-cookie --save-dev
pnpm add @redux-saga/core --save-dev
pnpm add debug --save-dev
pnpm add @types/debug --save-dev
pnpm add bindings --save-dev
danielweck commented 5 months ago

Hello, this code repository's software dependencies (including postinstall scripts policy, peer dependencies strategy, semantic versioning resolutions, etc.) are handled by the official NodeJS package manager (NPM). This project does not officially support PNPM, or Yarn, or Bun etc. The package "lock" file defines the exact versions that the software is tested with. Sometimes even non-major semver deviations (i.e. minor or patch) can introduce significant changes in Thorium's build process or runtime due to lower-quality transitive dependencies in the Node ecosystem (or just human error, to be fair). We are a very small development team so we cannot offer support for any other build environment / dependency graph, sorry. You might want to replicate Thorium's package-lock.json to match your preferred package manager, in order to mirror Thorium's currently-tested environment. I am moving this issue to a GitHub discussion as this is an interesting topic, but this is not actionable (not supported, no fix, no resolution).