npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

`npm install` returns error

What I Wanted to Do

I tried to install the ‘cheerio’ module. To achieve this I used the command npm install cheerio.

What Happened Instead

What happened instead is that I got an error message, linking to this error log, and it said that I should report it here, so here I am!

Reproduction Steps

I were able to reproduce the error by executing the exact same command (npm install cheerio). But in terms of reproducibility for others, I don’t know how you’d go about this.


My package.json looks like this.

Here is the debug log file again.

Platform Info

OS: Windows 10
Editor (I don’t know if relevant): Visual Studio Code
Command Line: Git Bash

$ npm --versions
{ myblog: '1.0.0',
  npm: '6.4.1',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.13.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '',
  zlib: '1.2.11' }

$ node -p process.platform

If you need any other information let me know!

Looks similar to Error running npm i react-image-crop --save, I’ll see if I can reproduce this one later. Edit: nope.

Do you have a package-lock.json file you can share? I think this is because of some invalid currentTree, which could be caused by a lot of things, and possibly an invalid install.

This probably happened due to corruption in your node_modules. Try removing the node_modules and trying again. In the meantime, we should probably not crash or at least give a better error message here.