I'm following the Conway's Game of Life tutorial for Rust and WebAssembly and I'm stuck at the point where I'm supposed to run npm install
to install dependencies. I keep getting ambiguous errors but after going through many different logs it boils down the RangeError: Maximum call stack size exceeded
.
I'm using
- macOS 10.14.2
- Node v10.15.1
- npm 6.7.0
- Rust 1.32.0 (with rustup, Cargo, and wasm-pack)
- webpack ^4.16.3
(copied from various manifest and -v
commands)
I've tried
- clearing npm's cache and re-running
npm install
like in this answer - Updating npm
- Reinstalling npm (and Node.js) from scratch (x2)
- Installing specific dependencies (like
npm install webpack
) - Downloading a package and running
npm install
on the archive
I noticed that I was getting some error 404's upon fetching some of xtuc's packages, supposedly because either the user is not found or because the URL contains non-url-friendly characters or something, but this is happening no matter what.
The log fails here
107 http fetch GET 404 https://registry.npmjs.org/@xtuc%2flong 1309ms
108 http fetch GET 404 https://registry.npmjs.org/@xtuc%2flong 406ms
109 silly fetchPackageMetaData error for @xtuc/long@4.2.1 404 Not Found - GET https://registry.npmjs.org/@xtuc%2flong - User not found
110 verbose stack RangeError: Maximum call stack size exceeded
110 verbose stack at RegExp.test (<anonymous>)
110 verbose stack at isDepOptional (/usr/local/lib/node_modules/npm/lib/install/deps.js:405:45)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:414:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
110 verbose stack at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
...
This keeps going on for a while.
The terminal output looks like this
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! ~/.npm/_logs/2019-02-01T00_45_12_400Z-debug.log
I have minimal experience with npm and node.js (I am more a Rust person) but I used to use them a lot a while ago and I never remember having this issue before.
That said, my best guess as to what's happening (purely from what the logs look like) is that npm can't fetch the package because it can't find the user, which is inadvertently causing some sort of loop that keeps calling the same function over and over again, eventually exceeding the call stack. I have no idea though.