Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm link can link to same directory -> Maximum call stack size exceeded #17610

Open
1 of 4 tasks
sk22 opened this issue Jul 4, 2017 · 0 comments
Open
1 of 4 tasks

npm link can link to same directory -> Maximum call stack size exceeded #17610

sk22 opened this issue Jul 4, 2017 · 0 comments

Comments

@sk22
Copy link

sk22 commented Jul 4, 2017

I'm opening this issue because:

  • npm is crashing.
  • npm is doing something I don't understand.
  • npm is producing an incorrect install.
  • Other (see below for feature requests):

What's going wrong?

After npm link-ing a module I apparently tried to link it to the very same directory. Maybe I did something similar, not sure about that, but it ended up like that:

C:\Users\samuel\Code\eslint-config-sk22\node_modules\eslint-config-sk22 is linked to C:\Users\samuel\Code\eslint-config-sk22.

So, almost every command related to npm fails with an RangeError similar to this:

RangeError: Maximum call stack size exceeded
    at Array.forEach (native)
    at exports.create (C:\Users\samuel\AppData\Roaming\npm\node_modules\npm\lib\install\node.js:33:25)
    at C:\Users\samuel\AppData\Roaming\npm\node_modules\npm\lib\install\node.js:36:14
    at Array.forEach (native)
    at exports.create (C:\Users\samuel\AppData\Roaming\npm\node_modules\npm\lib\install\node.js:33:25)
    at C:\Users\samuel\AppData\Roaming\npm\node_modules\npm\lib\install\node.js:36:14
    at Array.forEach (native)
    at exports.create (C:\Users\samuel\AppData\Roaming\npm\node_modules\npm\lib\install\node.js:33:25)
    at normalizeTree (C:\Users\samuel\AppData\Roaming\npm\node_modules\npm\lib\install.js:377:5)
    at Array.forEach (native)
    at normalizeTree (C:\Users\samuel\AppData\Roaming\npm\node_modules\npm\lib\install.js:379:19)
    at Array.forEach (native)
    at normalizeTree (C:\Users\samuel\AppData\Roaming\npm\node_modules\npm\lib\install.js:379:19)
    at Array.forEach (native)
    at normalizeTree (C:\Users\samuel\AppData\Roaming\npm\node_modules\npm\lib\install.js:379:19)
    at Array.forEach (native)

How can the CLI team reproduce the problem?

  1. Create a directory named bug-test
  2. In that directory, init a new npm module: npm init -y
  3. Run npm link
  4. Run npm link bug-test in the same directory
  5. See that ./node_modules/bug-test is linked to .
  6. Try to install a package, e.g. lodash: npm install lodash
  7. Watch the error happen: https://gist.github.com/anonymous/3214ba732ded61f00312fe29e3d49182

supporting information:

  • npm -v prints: 5.0.4
  • node -v prints: v8.0.0
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux? Windows
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants