You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot read property 'length' of undefined (npm 7.0.8) #2134
An error occurs during the installation of a new package.
Maybe relates to #2116
➜ git:(chore/npm-test) ✗ npm i --save-dev @graphql-codegen/typescript
npm ERR! code ERESOLVE
npm ERR! Cannot read property 'length' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/XXX/.npm/_logs/2020-11-06T11_25_39_984Z-debug.log
➜ node --version
v15.1.0
➜ npm --version
7.0.8
MacOS Catalina 10.15.7
Reacted by Roman Hotsiy, Jeremy-Bereszkowski, Luke Horsley, Sergey Dubovyk, Andriy Leliv, Bastien Jansen, Jayesh Tiwari, andoks, Alex Lee, Balint Csaszar (Chassy) and 1 more
Hey @okachynskyy! Sorry to hear you're having troubles. I just tried replicating this error & couldn't on the exact same setup (ie. os/node/npm version). Potentially, another dep you have in your tree is causing the problem or maybe has a peer conflict that can't be resolved (which is what the debug log seems to allude to). Can you try running that install again with either --force or using the legacy install behaviour w/ --legacy-peer-deps & see if that works/fixes anything?
I have the same problem with the package @angular/core (npm 7.0.9 and nodejs 15.1.0).
I used the command : ng update @angular/core :
`Using package manager: 'npm'
Collecting installed dependencies...
Found 55 dependencies.
Fetching dependency metadata from registry...
Updating package.json with dependency @angular/compiler-cli @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/language-service @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @types/jasmine @ "3.6.1" (was "3.6.0")...
Updating package.json with dependency @angular/animations @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/common @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/compiler @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/core @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/forms @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/localize @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/router @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/service-worker @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @ng-bootstrap/ng-bootstrap @ "8.0.0" (was "7.0.0")...
UPDATE package.json (2957 bytes)
\ Installing packages...npm ERR! code ERESOLVE
npm ERR! Cannot read property 'length' of undefined
npm ERR! C:\Users\edoua\AppData\Local\npm-cache_logs\2020-11-09T08_10_59_399Z-debug.log
× Package install failed, see above.
× Migration failed. See above for further details.`
Activity
darcyclarke commentedon Nov 6, 2020
Hey @okachynskyy! Sorry to hear you're having troubles. I just tried replicating this error & couldn't on the exact same setup (ie. os/node/npm version). Potentially, another dep you have in your tree is causing the problem or maybe has a peer conflict that can't be resolved (which is what the debug log seems to allude to). Can you try running that install again with either
--forceor using the legacy install behaviour w/--legacy-peer-deps& see if that works/fixes anything?Kichrum commentedon Nov 7, 2020
Have the same error on both 7.0.8 and 7.0.9 with a completely another setup (Angular 9 project), the error is quite not self-explanatory
--legacy-peer-depsfixes it, but I need a proper solution :)ebiton-eig commentedon Nov 9, 2020
I have the same problem with the package @angular/core (npm 7.0.9 and nodejs 15.1.0).
I used the command : ng update @angular/core :
`Using package manager: 'npm'
Collecting installed dependencies...
Found 55 dependencies.
Fetching dependency metadata from registry...
Updating package.json with dependency @angular/compiler-cli @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/language-service @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @types/jasmine @ "3.6.1" (was "3.6.0")...
Updating package.json with dependency @angular/animations @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/common @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/compiler @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/core @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/forms @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/localize @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/router @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @angular/service-worker @ "10.2.2" (was "10.2.0")...
Updating package.json with dependency @ng-bootstrap/ng-bootstrap @ "8.0.0" (was "7.0.0")...
UPDATE package.json (2957 bytes)
\ Installing packages...npm ERR! code ERESOLVE
npm ERR! Cannot read property 'length' of undefined
npm ERR! C:\Users\edoua\AppData\Local\npm-cache_logs\2020-11-09T08_10_59_399Z-debug.log
× Package install failed, see above.
× Migration failed. See above for further details.`
2020-11-09T08_10_59_399Z-debug.log
simllll commentedon Nov 10, 2020
Same with latest npm (7.0.9) and
--forceflag:But it seems it's happening in the bootstrap phase of lerna, if I adapt the paramters for the install paramter there, it also fails. Same stack trace:
The object that fails (explain-dep.js:68):
it seems the from has no "name" property.
isaacs commentedon Nov 11, 2020
Can you share your
package.jsonfile and/orpackage-lock.json?explain-dep: handle shortening edge from root project
isaacs commentedon Nov 11, 2020
Nevermind, found it. Fixed on #2156.
hiepxanh commentedon Nov 12, 2020
hope it will be fix soon, have the same error on
7.0.10versionrishabhpoddar commentedon Nov 13, 2020
I'm having this issue with all versions >=
7.0.7as well.explain-dep: handle shortening edge from root project
explain-dep: handle shortening edge from root project