Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm install --legacy-peer-deps throws error Cannot read properties of undefined (reading 'spec') #6456

Closed
2 tasks done
Roaders opened this issue May 16, 2023 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@Roaders
Copy link

Roaders commented May 16, 2023

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

running the command

npm install rxjs --legacy-peer-deps

with the npm package.json:

{
  "name": "peer-error",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "author": "",
  "license": "ISC",
  "peerDependencies": {
    "rxjs": "^7"
  }
}

gives the result:

D:\playground\peer-error - Copy>npm install rxjs --legacy-peer-deps
npm ERR! Cannot read properties of undefined (reading 'spec')

npm ERR! A complete log of this run can be found in: C:\Users\Giles\AppData\Local\npm-cache\_logs\2023-05-16T07_36_43_983Z-debug-0.log 

Expected Behavior

the install should succeed

Steps To Reproduce

  1. In this environment...
    Windows
  2. With this config...
{
  "name": "peer-error",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "author": "",
  "license": "ISC",
  "peerDependencies": {
    "rxjs": "^7"
  }
}
  1. Run '...'
    npm install rxjs --legacy-peer-deps
  2. See error...
    npm ERR! Cannot read properties of undefined (reading 'spec')
verbose title npm install rxjs
23 verbose argv "install" "rxjs" "--legacy-peer-deps"
24 timing npm:load:setTitle Completed in 1ms
25 timing config:load:flatten Completed in 2ms
26 timing npm:load:display Completed in 2ms
27 verbose logfile logs-max:10 dir:C:\Users\Giles\AppData\Local\npm-cache\_logs
28 verbose logfile C:\Users\Giles\AppData\Local\npm-cache\_logs\2023-05-16T07_35_03_353Z-debug-0.log
29 timing npm:load:logFile Completed in 3ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 15ms
33 timing arborist:ctor Completed in 1ms
34 silly logfile start cleaning logs, removing 4 files
35 timing arborist:ctor Completed in 1ms
36 silly logfile done cleaning log files
37 timing idealTree:init Completed in 6ms
38 timing idealTree:userRequests Completed in 1ms
39 silly idealTree buildDeps
40 timing idealTree:#root Completed in 0ms
41 timing idealTree:buildDeps Completed in 1ms
42 timing idealTree:fixDepFlags Completed in 0ms
43 timing idealTree Completed in 8ms
44 timing reify:loadTrees Completed in 8ms
45 timing reify:diffTrees Completed in 1ms
46 silly reify moves {}
47 timing reify:retireShallow Completed in 0ms
48 timing reify:createSparse Completed in 0ms
49 timing reify:loadBundles Completed in 0ms
50 silly audit report null
51 timing reify:audit Completed in 0ms
52 timing reify:unpack Completed in 0ms
53 timing reify:unretire Completed in 0ms
54 timing build:queue Completed in 0ms
55 timing build:deps Completed in 0ms
56 timing build Completed in 0ms
57 timing reify:build Completed in 0ms
58 timing reify:trash Completed in 0ms
59 timing command:install Completed in 18ms
60 verbose stack TypeError: Cannot read properties of undefined (reading 'spec')
60 verbose stack     at updateNodes (C:\Users\Giles\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:1179:44)
60 verbose stack     at [saveIdealTree] (C:\Users\Giles\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:1348:11)
60 verbose stack     at Arborist.reify (C:\Users\Giles\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:156:31)
60 verbose stack     at async Install.exec (C:\Users\Giles\AppData\Roaming\npm\node_modules\npm\lib\commands\install.js:145:5)
60 verbose stack     at async module.exports (C:\Users\Giles\AppData\Roaming\npm\node_modules\npm\lib\cli.js:78:5)
61 verbose cwd D:\playground\peer-error - Copy
62 verbose Windows_NT 10.0.22621
63 verbose node v18.15.0
64 verbose npm  v8.19.2
65 error Cannot read properties of undefined (reading 'spec')
66 verbose exit 1
67 timing npm Completed in 105ms
68 verbose unfinished npm timer reify 1684222503438
69 verbose unfinished npm timer reify:save 1684222503455
70 verbose code 1
71 error A complete log of this run can be found in:
71 error     C:\Users\Giles\AppData\Local\npm-cache\_logs\2023-05-16T07_35_03_353Z-debug-0.log

Environment

  • npm: 9.6.6
  • Node.js: 18.15.0
  • OS Name: Windows
  • npm config:
; "builtin" config from C:\Users\Giles\AppData\Roaming\npm\node_modules\npm\npmrc

prefix = "C:\\Users\\Giles\\AppData\\Roaming\\npm"

; node bin location = C:\Program Files\nodejs\node.exe
; node version = v18.15.0
; npm local prefix = D:\playground\peer-error - Copy
; npm version = 9.6.6
; cwd = D:\playground\peer-error - Copy
; HOME = C:\Users\Giles
; Run `npm config ls -l` to show all defaults.
@Roaders Roaders added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels May 16, 2023
@Roaders
Copy link
Author

Roaders commented May 16, 2023

this is an issue on npm version 8 and on latest npm version 9 (9.6.6)

@wraithgar
Copy link
Member

#4819
#5961

@wraithgar wraithgar closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

2 participants