npm portgroup default version

contextnerror contextnerror at outlook.com
Tue Apr 16 18:20:28 UTC 2024


I looked into this today. Here’s what works with nodejs20:
bash-language-server: works
eask-cli: works
pnpm: works
pyright: works
bitwarden-cli: works (broken without the change)

typescript-language-server does not work with nodejs20. I can’t get it to work with nodejs16 either, so this might be user error.
Chnagelog requires node 18+ after version 4.0.0 and they test against 20 in the github actions, so I’m assuming this is meant to work.
Here are the errors:

20:

typescript-language-server --version
file:///opt/local/lib/node_modules/typescript-language-server/lib/protocol-translation.js:8
import vscodeUri from 'vscode-uri';
       ^^^^^^^^^
SyntaxError: The requested module 'vscode-uri' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Node.js v20.12.2

16:

typescript-language-server --version
file:///opt/local/lib/node_modules/typescript-language-server/lib/protocol-translation.js:8
import vscodeUri from 'vscode-uri';
       ^^^^^^^^^
SyntaxError: The requested module 'vscode-uri' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)


> On Mar 23, 2024, at 12:36 AM, Blair Zajac <blair at orcaware.com> wrote:
> 
> It’s only seen two commits in its entire history with only a handful of ports using it:
> 
> bash-language-server
> eask-cli
> pnpm
> pyright
> typescript-language-server
> bitwarden-cli
> 
> With this low number of ports, one could check if they work with nodejs20.
> 
> Blair
> 
>> On Mar 23, 2024, at 12:01 AM, contextnerror <contextnerror at outlook.com> wrote:
>> 
>> Is there a reason why the npm portgroup still defaults to nodejs16? It’s been EOL for a little bit now.
>> 
> 



More information about the macports-dev mailing list