dcmjs-org / dcmjs

Javascript implementation of DICOM manipulation
https://dcmjs.netlify.com/
MIT License
291 stars 110 forks source link

Create Node version constraint at >= v11 #321

Open vjau opened 1 year ago

vjau commented 1 year ago

Should fix #319 This change put a hard constraint on Node version number : npm should prevent users from installing if node version is under v11 which is the first version that has TextEncoder in the global object like in the browser. Changes in package.json set the node version constraint in the engines entry. The engine-strict directive in the added .npmrc file should tell npm to enforce the constraint at npm install time. I modified documentation accordingly. Alternatively, we could just limit the constraint to a warning in the documentation and let users install at their own risk.

pieper commented 1 year ago

The netlify checks are failing now, saying the node version is too old.

E.g. from https://app.netlify.com/sites/dcmjs/deploys/634281592ae0f90008b99d5c :

4:08:09 AM: Installing NPM modules using NPM version 6.13.4
4:08:10 AM: npm ERR! code ENOTSUP
4:08:10 AM: npm ERR! notsup Unsupported engine for dcmjs@0.24.0: wanted: {"node":">=11.0.0"} (current: {"node":"8.17.0","npm":"6.13.4"})
4:08:10 AM: npm ERR! notsup Not compatible with your version of node/npm: dcmjs@0.24.0
4:08:10 AM: npm ERR! notsup Not compatible with your version of node/npm: dcmjs@0.24.0
4:08:10 AM: npm ERR! notsup Required: {"node":">=11.0.0"}
4:08:10 AM: npm ERR! notsup Actual:   {"npm":"6.13.4","node":"8.17.0"}
4:08:10 AM: npm ERR! A complete log of this run can be found in:
4:08:10 AM: npm ERR!     /opt/buildhome/.npm/_logs/2022-10-09T08_08_10_287Z-debug.log
4:08:10 AM: Error during NPM install
4:08:10 AM: Build was terminated: Build script returned non-zero exit code: 1

Looks like @dannyrb removed the pinned version but perhaps we need to add it back now: https://github.com/dcmjs-org/dcmjs/commit/3e2978be96fc111d920018d4afe5f9bd5b3e355d