Can't Run Javascript Tests at Home: missing corepack

My version of node is very old…but I assume that npm test uses a relatively new version. Google search tells me that corepack is being removed from newer versions of node. I prefer to run at home until I have something ‘presentable’ – not necessarily passing…what can I do?

Instructions on setting things up locally can be found here. Installing JavaScript locally | Exercism's Docs

I have an installed CLI on which I have been able to solve over half the exercises on the Javascript track. I have changed nothing. For the last 2 exercises I’ve downloaded I’ve been unable to run the test suite because of the corepack error.

I am now more confused than before: you seem to indicate that the test suite is using my version of node, yet a few exercises ago, when corepack was apparently still in place, my local node did not recognize toSorted() as a valid array function, yet when I ran the same code through the test suite therre was no such problem, which made me think that it is using a different version of node.

I have no idea what you’re running or using. I have no idea what is happening in your local environment. I simply linked you to the track docs for setting things up locally.

If you follow those docs, you should have everything you need. If you have multiple versions of node installed, you may need to do something to ensure you’re using the right one.

The testsuite uses babel to provide latest node features for older versions of node. It may be that babel dropped support for your “very old” version.

It may help, if you could post the exact error message you get in a code block. Also we may use the output of node -v to find out if babel still supports your node version.

Corepack will be removed in the future, but is still available in LTS (and even current Node). Once it will be removed, we’ll also remove it from our toolchain, which is not hard as we’ve been consistent with the corepack usage.

The reason the track is now asking for corepack, is because it’s part of this big overhaul PR that also switches to pnpm.

The installation instructions now have a step to enable corepack. This is a one time thing. Later, when corepack is gone, it will be replaced with the instructions how to install pnpm.


FYI

My version of node is very old

We officially only support LTS node, which is currently Node 22. And we attempt to support those in maintenance mode (currently 20 and 18).

Thank you, SleeplessByte, and mk-mxp, and Isaac Good.
Until now, I’ve been able to survive on my node version 14.11.0. I will have to see what node version is still compatible with my 10 year old desktop mac

1 Like

If you’re willing to install the dependencies using npm install and are willing to run the tests by manually calling jest, you can ignore all the corepack stuff.