2

I am following the following guide from GitHub Here but when I enter npm init I keep getting the error:

Sorry, there's a problem with nodist. Couldn't resolve node version spec %s: %s 11.13.0 Couldn't find any matching version

I have followed the previous steps and set the version to v10.15.3, but the error keeps appearing every time I use nvm. I have also set the version to v11.13.0, as this is what the error is requesting, but I still get the same result. Installed versions include: 11.13.0, 10.16.0, 10.15.3, 8.11.2, 0.12.0

Any help with this would be much appreciated!

Super Jade
  • 5,609
  • 7
  • 39
  • 61
grand2019
  • 562
  • 2
  • 6
  • 16

3 Answers3

1

There are several reasons which can cause this problem:

  1. If due to some reasons like poor internet connection your node or npm versions you have downloaded are corrupted. In this case you need to remove the files .npm-version-global and .node-version-global as well as empty the folders v, v-64 and npmv within the installation of the Nodist folder.
  2. You have a local version of the node specified in .node-version file in the root directory of your project. In this case you need to install that version by nodist local XXX where XXX is the version of the node in .node-version file.
Musa Haidari
  • 2,109
  • 5
  • 30
  • 53
0

In my case, the problem was that I had a node version specified in my code repo that didn't match the node version installed on my machine. I needed the updated node version on my machine, so

  1. I opened file explorer to the root of my repo.
  2. I opened .node-version and edited the version number to the updated version I needed.
  3. npm cache clean --force to start with a fresh cache. (Note: Others have said that npm cache clean --force is outdated, but this command worked for both my teammate and for me using npm version 6.9.0.)
  4. npm install to reinstall my node modules.
  5. npm run build and I had a clean build. Yay!
Super Jade
  • 5,609
  • 7
  • 39
  • 61
0

For Node 18 and npm 8.19.1, I found the advice at https://github.com/nullivex/nodist/issues/252#issuecomment-1170897428 useful.

I was getting cb.apply errors, and problems with @npmcli/arborist and libnpmfund, but I created those two links from the list.

I was using npx. This installs an old (v 5.8) version of npm inside its node_modules. That npm contains graceful-fs inside its node_modules. The cb.apply error was coming frome graceful-fs's polyfill.js.

I installed the latest version of graceful-fs, and copied the newer polyfill.js into the abovementioned (child of npm's) graceful-fs. This seemed to fix the problem for me.

John
  • 6,701
  • 3
  • 34
  • 56