Repository navigation
[BUG] Cannot read properties of undefined (reading 'spec') #4819
Copy link
Copy link
Open
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsPriority 3Release 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release
Description
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
I develop a nextjs application. I want to use react-table package specific version from github. I tried the below command in the terminal:
npm install git://github.com/tanstack/react-table.git#v8.0.0-alpha.51It starts to download but stucked after a while and ended with the error Cannot read properties of undefined (reading 'spec')
Here is the npm log:
49 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-win32-x64-msvc
50 silly reify mark deleted [
50 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-win32-x64-msvc'
50 silly reify ]
51 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-win32-ia32-msvc
52 silly reify mark deleted [
52 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-win32-ia32-msvc'
52 silly reify ]
53 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-win32-arm64-msvc
54 silly reify mark deleted [
54 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-win32-arm64-msvc'
54 silly reify ]
55 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-x64-musl
56 silly reify mark deleted [
56 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-x64-musl'
56 silly reify ]
57 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-x64-gnu
58 silly reify mark deleted [
58 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-x64-gnu'
58 silly reify ]
59 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-arm64-musl
60 silly reify mark deleted [
60 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-arm64-musl'
60 silly reify ]
61 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-arm64-gnu
62 silly reify mark deleted [
62 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-arm64-gnu'
62 silly reify ]
63 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-arm-gnueabihf
64 silly reify mark deleted [
64 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-linux-arm-gnueabihf'
64 silly reify ]
65 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-darwin-arm64
66 silly reify mark deleted [
66 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-darwin-arm64'
66 silly reify ]
67 verbose reify failed optional dependency /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-android-arm64
68 silly reify mark deleted [
68 silly reify '/Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web/node_modules/@next/swc-android-arm64'
68 silly reify ]
69 timing reifyNode:node_modules/@next/swc-win32-x64-msvc Completed in 21ms
70 timing reifyNode:node_modules/@next/swc-win32-ia32-msvc Completed in 21ms
71 timing reifyNode:node_modules/@next/swc-win32-arm64-msvc Completed in 22ms
72 timing reifyNode:node_modules/@next/swc-linux-x64-musl Completed in 22ms
73 timing reifyNode:node_modules/@next/swc-linux-x64-gnu Completed in 22ms
74 timing reifyNode:node_modules/@next/swc-linux-arm64-musl Completed in 21ms
75 timing reifyNode:node_modules/@next/swc-linux-arm64-gnu Completed in 21ms
76 timing reifyNode:node_modules/@next/swc-linux-arm-gnueabihf Completed in 21ms
77 timing reifyNode:node_modules/@next/swc-darwin-arm64 Completed in 21ms
78 timing reifyNode:node_modules/@next/swc-android-arm64 Completed in 21ms
79 http fetch GET 200 https://codeload.github.com/tanstack/react-table/tar.gz/a642b36b4faff416d17a5a22a11682772afa2572 521ms (cache revalidated)
80 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 642ms
81 timing auditReport:getReport Completed in 651ms
82 silly audit report {
82 silly audit report underscore: [
82 silly audit report {
82 silly audit report id: 1068134,
82 silly audit report url: 'https://github.com/advisories/GHSA-cf4h-3jhx-xvhq',
82 silly audit report title: 'Arbitrary Code Execution in underscore',
82 silly audit report severity: 'high',
82 silly audit report vulnerable_versions: '>=1.3.2 <1.12.1',
82 silly audit report cwe: [Array],
82 silly audit report cvss: [Object]
82 silly audit report }
82 silly audit report ]
82 silly audit report }
83 timing metavuln:cache:get:security-advisory:underscore:Gnjmi1IOOUemQLeLgz5wRwLH47Eo9UznXoQR7+paJUZ5akz/mDNxKZhNia4PfEO25soJ4Pui+zZrnP/UDRFcrg== Completed in 3ms
84 http fetch GET 200 https://registry.npmjs.org/underscore 99ms (cache revalidated)
85 timing metavuln:packument:underscore Completed in 99ms
86 timing metavuln:load:security-advisory:underscore:1068134 Completed in 1ms
87 timing metavuln:calculate:security-advisory:underscore:1068134 Completed in 101ms
88 timing metavuln:cache:get:security-advisory:nomnom:DQUhFjyX429qptn/n8Uhfq7YeZIdBe9/qacpIYBWZ2pIHThXVcKYs0RH5u7CWrWBHCMXnb5SXhAcRszvQ9hi6g== Completed in 2ms
89 http fetch GET 200 https://registry.npmjs.org/nomnom 89ms (cache revalidated)
90 timing metavuln:packument:nomnom Completed in 89ms
91 timing metavuln:load:security-advisory:nomnom:Gnjmi1IOOUemQLeLgz5wRwLH47Eo9UznXoQR7+paJUZ5akz/mDNxKZhNia4PfEO25soJ4Pui+zZrnP/UDRFcrg== Completed in 0ms
92 timing metavuln:calculate:security-advisory:nomnom:Gnjmi1IOOUemQLeLgz5wRwLH47Eo9UznXoQR7+paJUZ5akz/mDNxKZhNia4PfEO25soJ4Pui+zZrnP/UDRFcrg== Completed in 89ms
93 timing metavuln:cache:get:security-advisory:local-ssl-proxy:ofKTNzg2i4mGw/PKqqfCg/6pbQW50RjEeKeGZZ6obFI7sSCOXuX0wG4lQEigM0ScX2Nf8gr1Guioi7wIQ29fkQ== Completed in 2ms
94 http fetch GET 200 https://registry.npmjs.org/local-ssl-proxy 91ms (cache revalidated)
95 timing metavuln:packument:local-ssl-proxy Completed in 91ms
96 timing metavuln:load:security-advisory:local-ssl-proxy:DQUhFjyX429qptn/n8Uhfq7YeZIdBe9/qacpIYBWZ2pIHThXVcKYs0RH5u7CWrWBHCMXnb5SXhAcRszvQ9hi6g== Completed in 0ms
97 timing metavuln:calculate:security-advisory:local-ssl-proxy:DQUhFjyX429qptn/n8Uhfq7YeZIdBe9/qacpIYBWZ2pIHThXVcKYs0RH5u7CWrWBHCMXnb5SXhAcRszvQ9hi6g== Completed in 92ms
98 timing auditReport:init Completed in 286ms
99 timing reify:audit Completed in 937ms
100 timing reifyNode:node_modules/undefined Completed in 83750ms
101 timing reify:unpack Completed in 83752ms
102 timing reify:unretire Completed in 0ms
103 timing build:queue Completed in 49ms
104 timing build:deps Completed in 50ms
105 timing build Completed in 50ms
106 timing reify:build Completed in 51ms
107 timing reify:trash Completed in 1729ms
108 timing command:install Completed in 90889ms
109 verbose stack TypeError: Cannot read properties of undefined (reading 'spec')
109 verbose stack at updateNodes (/Users/talatkuyuk/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:1177:44)
109 verbose stack at Arborist.[saveIdealTree] (/Users/talatkuyuk/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:1344:11)
109 verbose stack at Arborist.reify (/Users/talatkuyuk/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:156:31)
109 verbose stack at async Install.exec (/Users/talatkuyuk/.nvm/versions/node/v16.15.0/lib/node_modules/npm/lib/commands/install.js:159:5)
109 verbose stack at async module.exports (/Users/talatkuyuk/.nvm/versions/node/v16.15.0/lib/node_modules/npm/lib/cli.js:66:5)
110 verbose cwd /Users/talatkuyuk/MyCodeRepo/nextprojects/amazon-ht-web
111 verbose Darwin 19.6.0
112 verbose argv "/Users/talatkuyuk/.nvm/versions/node/v16.15.0/bin/node" "/Users/talatkuyuk/.nvm/versions/node/v16.15.0/bin/npm" "install" "git://github.com/tanstack/react-table.git#v8.0.0-alpha.51"
113 verbose node v16.15.0
114 verbose npm v8.5.5
115 error Cannot read properties of undefined (reading 'spec')
116 verbose exit 1
117 timing npm Completed in 91074ms
118 verbose unfinished npm timer reify 1651116372524
119 verbose unfinished npm timer reify:save 1651116463410
120 verbose code 1
121 error A complete log of this run can be found in:
121 error /Users/talatkuyuk/.npm/_logs/2022-04-28T03_26_12_342Z-debug-0.log
Expected Behavior
I expect the npm install the react-table package from GitHub
Steps To Reproduce
- It is nextjs application
- Run 'npm install git://github.com/tanstack/react-table.git#v8.0.0-alpha.51'
- See error...
Cannot read properties of undefined (reading 'spec')
Environment
- npm: v8.5.5
- Node.js: v16.15.0
- OS Name: MacBook Pro
- System Model Name: Mac OS
- npm config:
; node bin location = /Users/talatkuyuk/.nvm/versions/node/v16.15.0/bin/node
; cwd = /Users/talatkuyuk/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist
; HOME = /Users/talatkuyuk
; Run `npm config ls -l` to show all defaults.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsPriority 3Release 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release
Activity
PedroC88 commentedon Apr 28, 2022
I'm having the same error installing ADF Utilities:
PedroC88 commentedon Apr 28, 2022
Alright, so here's a bit more detail, perhaps it's a layer-8 error?
npm installcommand runs successfullypipelinesfolder and runningnpm installfrom the pipelines folder it runs successfullypipelinesfolder and runningnpm install .\pipelinesfrom the root folder it failsI also realized that even with the error the packages are (or appear to be) restored.
P.S. this is all running on a Windows 11 Terminal with a PowerShell 7.2.3 session
Jeremy-coding commentedon Aug 27, 2022
I'm also getting this error. I'm on npm 8.11.0.
Should be reproducible for anyone else.
WilcoFiers commentedon Sep 5, 2022
Had this issue too. The problem turned out to come from package.json not having a
nameproperty. Adding that in solved the issue for me.corngood commentedon Sep 5, 2022
For me, this was caused by having
node.exenext topackage.jsonin the root of our tree. Moving it into any other directory fixed the problem. NPM treats wherever the node binary lives as the 'distro root' and does some special magic.daniel-rebolledo commentedon Oct 13, 2022
I have the same problem, in my case running
npm install react react-dom. On mypackage.jsonI have these two packages aspeerDependencies, if I move those todevDependenciesand then runnpm installthe error is gone and all the packages are installed. I always have to move back those packages topeerDependenciesafter that.npm: 8.11.0
node: 16.15.1
prathyushSunny commentedon Oct 14, 2022
@daniel-rebolledo Thanks! Your approached resolved it. I had the same issue while doing
npm i reactbut not anymore.que273 commentedon Oct 21, 2022
I appear to have the same issue as @daniel-rebolledo with peerDependencies. Oddly for me it was working with
registry.npmjs.orgbut not when I switched to a private mirror registry. The issue went away when I specified the//legacy-peer-deps=trueoption to the registry in.npmrcShhad commentedon Nov 11, 2022
@que273 yes! I have same config field in
.npmrc. Do you know why it behaves like that?zloirock commentedon Nov 12, 2022
I have this issue after moving
cd path && npm i->npm i --prefix path, https://github.com/zloirock/core-js/actions/runs/3452139442/jobs/5761893828, diff: zloirock/core-js@e503cc2JonathanMerklin commentedon Mar 22, 2023
Thought I'd call out that I was experiencing this when migrating a module (in our internal registry) to be built in and compatible with Node 18 / the latest NPM (the module had been around since the Node 0.x days, and its purpose was "install this one package as a devDependency in order to get a bunch of unit testing tooling packages at once") and was receiving this when trying to install
chai-enzymeregardless of whether it was a peer or dev dependency.Fortunately, for us, we weren't really "using"
chai-enzymein the module or in anything we owned, so we were able to just throw in the migration guide "no longer includingchai-enzyme, and since you should prefer<alternativeMoreModernLibrariesAndMechanismsForUnitTestingWeAreUsingInOtherPlaces />, if you are usingchai-enzymein your extant test code, you're on your own".The point: if you're running into this, you could try removing individual packages one-at-a-time (and then in pairs, and then in triplets, etc.) until you no longer see this behavior, to isolate a problem dependency or set thereof, but from there the prescription would be entirely context-dependent.
ph3rro commentedon Mar 27, 2023
I have this issue when I fork a package. The original package installs fine, but the forked version doesn't.
Original version: https://github.com/BenJeau/react-native-draw
Forked version: https://github.com/sickopickle/react-native-draw
I made no changes so I don't know why this would happen.
ami-momo commentedon Sep 8, 2024
This happened to me when I wanted to use
npx somecommandfrom my package, but my package did not have thenameproperty inpackage.jsonand caused this error:Though
bunxdid not have any problem, but it seems it caused error usingnpxmwaibel-go commentedon Nov 26, 2024
I’m currently facing this issue with npm version 10.9.1. I have no idea what might be causing this in my case.
wu-lee commentedon Jan 7, 2026
I'm seeing this error too.
Situation: installing a package directly from GitHub.
Versions:
Same error, but the message "A complete log of this run can be found in" references a non-existing file.
The installed package is one with workspaces, which have "name" and "version" attributes, and but the top-level package.json does not have the "name" attribute. (It is not marked private.)
Adding "name" to the top-level package.json leads to a failure with:
(No value given after "Version")
But adding a "version" attribute does get to a successful install!
So it does appear to be that the code is making unguarded assumptions about the package.json fields present.
There are still some warnings, which may be unrelated:
package.json - add name, version and module fields
package.json - add name, version and module fields
package.json - add name, version and module fields
package.json - add name, version and module fields
mvanhorn commentedon Oct 22, 2026
An add spec that arrives without a name is meant to take that name from the fetched manifest. When the manifest name is missing or an empty string, the dependency is stored under the key "undefined" and no outgoing edge is created.
After the manifest is loaded, a spec that still has no name and whose manifest name is missing or empty throws EMISSINAME, carrying the raw spec, before that dependency is recorded. Explicit-request collection adds an edge only when edgesOut returns one.
#10154