Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for non-tip LTS versions of node #1628

Closed
betaorbust opened this issue Jul 14, 2021 · 4 comments
Closed

Support for non-tip LTS versions of node #1628

betaorbust opened this issue Jul 14, 2021 · 4 comments
Labels
bug Functionality does not match expectation

Comments

@betaorbust
Copy link
Contributor

Currently, the engines setting in typedoc breaks yarn installs on all machines not running tip LTS. Is there a known hard requirement for 12.20, or could it be relaxed back to 12?

Search terms

Node version, minimum version

Expected Behavior

Allows installing on non-tip Node 12

Actual Behavior

Yarn aborts at install because minimum version is not supported.

error typedoc@0.21.4: The engine "node" is incompatible with this module. Expected version ">= 12.20.0". Got "12.19.1"
error Found incompatible module.

image

Steps to reproduce the bug

mkdir test && cd test && yarn init -y.  # Set up test package
nvm use 12.19                           # Use < 12.20
yarn add typescript typedoc --dev       # install 

Environment

  • Typedoc version: Latest
  • TypeScript version: Latest
  • Node.js version: LTS<12.20
  • OS: Mac
@betaorbust betaorbust added the bug Functionality does not match expectation label Jul 14, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jul 15, 2021

There was a requirement for it, in that part of TypeDoc used node: style imports when @types/node would suggest those imports over the older ones, I think they have all been removed now though... it could probably be relaxed. https://nodejs.org/api/esm.html#esm_node_imports.

@betaorbust
Copy link
Contributor Author

Just went to make a PR and tested that it works (tests complete correctly) down to 12.10.0, but lower than that and there are test errors. I'll relax it back to there in the PR.

Would you like the testing matrix in ./github/workflows/ci.yml to change to

name: CI
on: [push, pull_request]
jobs:
    build:
        runs-on: ubuntu-latest
        strategy:
            matrix:
-                node: ["12", "14", "16"]
+                node: ["12.10", "12", "14", "16"]
        name: Node ${{ matrix.node }

to reflect the engine limitations (while still testing against lts tip), just 12.10, or just 12?

@betaorbust
Copy link
Contributor Author

I believe the project can work lower than 12.10, but 5ffe73d removed fs-extra in favor of rmdir({recursive: true}) which only has support from 12.10.

await fsp.rmdir(target, { recursive: true });

Didn't know what your feelings were on reintroducing fs-extra, del or rolling your own for greater compatibility, but I'll put in the PR to pull it back to 12.10 for now.

betaorbust added a commit to betaorbust/typedoc that referenced this issue Jul 15, 2021
Lower than 12.10 would require refactoring src/lib/utils/fs.ts to use something other than fs.rmdir({ recursive: true }), which was introduced in 12.10 https://nodejs.org/docs/latest-v12.x/api/fs.html#fs_fs_rmdir_path_options_callback
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jul 16, 2021

I'd rather not add more dependencies - as time goes on I've become more and more reluctant to add third party code to projects I maintain. There are some dependencies that it's definitely worth having (I wouldn't want to write glob!), but for trivial things like this, that is supported by recent versions of Node itself, dependencies are just bloat.

Node 12 itself is already heading towards EOL, I don't think it's worth it to spend time trying to support lower and lower versions when all support for node 12 is going to be dropped the day it hits EOL. If you're stuck on a older version of Node, you have my utmost sympathies, and encouragement to fight whatever process is keeping you from upgrading Node (If it's cyber approval... don't they realize that Node upgrades aren't just noise? there are real issues)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants