I’m following this official tutorial:
https://nextjs.org/learn/react-foundations/installation
When I run this command:
<code>npm install react@latest react-dom@latest next@latest
</code>
<code>npm install react@latest react-dom@latest next@latest
</code>
npm install react@latest react-dom@latest next@latest
I got this error:
<code>npm error Cannot read properties of null (reading 'matches')
</code>
<code>npm error Cannot read properties of null (reading 'matches')
</code>
npm error Cannot read properties of null (reading 'matches')
The result in package.json file is:
<code>{}
</code>
<code>{}
</code>
{}
The latest error in the log is:
<code>15063 verbose stack TypeError: Cannot read properties of null (reading 'matches')
15063 verbose stack at Link.matches (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1115:41)
15063 verbose stack at Link.canDedupe (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1069:15)
15063 verbose stack at PlaceDep.pruneDedupable (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:426:14)
15063 verbose stack at new PlaceDep (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:278:14)
15063 verbose stack at #buildDepStep (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:939:18)
15063 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:203:7)
15063 verbose stack at async Promise.all (index 1)
15063 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
15063 verbose stack at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:150:5)
15063 verbose stack at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:74:5)
15064 verbose cwd /Users/bcarneiro/MyProjects/nextjs-dashboard
15065 verbose Darwin 23.4.0
15066 verbose node v20.15.0
15067 verbose npm v10.7.0
15068 error Cannot read properties of null (reading 'matches')
15069 verbose exit 1
15070 verbose code 1
</code>
<code>15063 verbose stack TypeError: Cannot read properties of null (reading 'matches')
15063 verbose stack at Link.matches (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1115:41)
15063 verbose stack at Link.canDedupe (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1069:15)
15063 verbose stack at PlaceDep.pruneDedupable (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:426:14)
15063 verbose stack at new PlaceDep (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:278:14)
15063 verbose stack at #buildDepStep (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:939:18)
15063 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:203:7)
15063 verbose stack at async Promise.all (index 1)
15063 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
15063 verbose stack at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:150:5)
15063 verbose stack at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:74:5)
15064 verbose cwd /Users/bcarneiro/MyProjects/nextjs-dashboard
15065 verbose Darwin 23.4.0
15066 verbose node v20.15.0
15067 verbose npm v10.7.0
15068 error Cannot read properties of null (reading 'matches')
15069 verbose exit 1
15070 verbose code 1
</code>
15063 verbose stack TypeError: Cannot read properties of null (reading 'matches')
15063 verbose stack at Link.matches (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1115:41)
15063 verbose stack at Link.canDedupe (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1069:15)
15063 verbose stack at PlaceDep.pruneDedupable (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:426:14)
15063 verbose stack at new PlaceDep (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:278:14)
15063 verbose stack at #buildDepStep (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:939:18)
15063 verbose stack at async Arborist.buildIdealTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:203:7)
15063 verbose stack at async Promise.all (index 1)
15063 verbose stack at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
15063 verbose stack at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:150:5)
15063 verbose stack at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:74:5)
15064 verbose cwd /Users/bcarneiro/MyProjects/nextjs-dashboard
15065 verbose Darwin 23.4.0
15066 verbose node v20.15.0
15067 verbose npm v10.7.0
15068 error Cannot read properties of null (reading 'matches')
15069 verbose exit 1
15070 verbose code 1
I’m new to frontend development and I have no idea how to debug and fix it.
The full log is here: https://drive.google.com/file/d/1YUnLYuhjceuA2Eh0eGtNDvRqgjzUCAna/view?usp=sharing
1