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.

I need to reopen this discussion.
I’ve now replaced my Intel chip Mac, so I’ve needed to replace the entire node installation. My son used brew to install node, and the version it provided is 25.1.0 which no longer includes corepack. He requests the specific version of corepack to install. Apparently I’ve gone from a node too old to run the tests to a node too new to run the tests…

I think Node LTS currently is v24.something which still includes corepack bundled, so one option is to downgrade to LTS.

Another option is to install corepack standalone, check the github repo here for how to do it.

Finally, as DJ has mentioned in the last post above you, you can ignore the corepack stuff it you’re willing to fiddle with the other tools and dependencies.

We do not support odd-version numbers for Node. Once 26 lands, we’ll either remove corepack or change the it in the instructions.

It came as a surprise that Homebrew defaulted to what is effectively an experimental version of node.js. I had initially run:

brew install node

To fix this – at least as far as I’ve gotten, since mom is probably asleep by now – I ran:

brew remove node
brew install node@24
brew link --overwrite node@24

At least, now node --version; corepack --version produces output for both (‘v24.11.0’ and ‘0.34.0’).

1 Like

Yeah, that’s why the brew instructions purposefully pin it to a stable version:

1 Like

So if you come in from the Node.js web site, it directs you. If you come in from Homebrew command line it’s just a mystery waiting to stab you. Well, I guess that’s how software ecosystems work these days. (BTW, just brew install node@24 didn’t work for me, I guess because I had previously installed just node; despite having first cleaned up by removing the unspecified-version node package.)

Anyway this is somewhat afield of Exercism; except in that, if it’s going to have to stop using corepack for Node 26, perhaps that could be done sooner, so people who inadvertently install Node 25 have a better experience…

BTW mom did confirm that she was able to run exercise tests now. Don’t know if she’s loaded an entire new exercise since the major upheaval, but – seems like it’s going to work…

1 Like

corepack won’t be gone (as of yet), but it won’t be included by default. I have not decided on what to do. npm is just way less efficient at the setup we have, so pnpm or yarn would be the way to go. We’re on yarn in TypeScript and pnpm in JavaScript. Both have pros and cons in terms of our tooling, but both also require an extra installation step over npm…

Time will tell!

1 Like