I have a problem whenever I try to install the @apollo/client
I do:
npm install @apollo/client
And i get the following result in the terminal:
npm ERR! Cannot read property 'matches' of undefined
npm ERR! A complete log of this run can be found in:
I tried deleting both node_modules and package-lock and npm installing again but I still run into the same error.
This is the log (if it helps you):
0 verbose cli [
0 verbose cli '/Users/************/.nvm/versions/node/v15.0.1/bin/node',
0 verbose cli '/Users/************/.nvm/versions/node/v15.0.1/bin/npm',
0 verbose cli 'install',
0 verbose cli '@apollo/client'
0 verbose cli ]
1 info using npm@7.0.3
2 info using node@v15.0.1
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:/Users/************/.nvm/versions/node/v15.0.1/lib/node_modules/npm/npmrc Completed in 0ms
5 timing config:load:builtin Completed in 0ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/Users/************/dev/twitterlike/client/.npmrc Completed in 0ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:/Users/************/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/Users/************/.nvm/versions/node/v15.0.1/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 4ms
19 verbose npm-session a83a368ebfce0eee
20 timing npm:load Completed in 10ms
21 timing arborist:ctor Completed in 1ms
22 timing idealTree:init Completed in 592ms
23 timing idealTree:userRequests Completed in 3ms
24 silly idealTree buildDeps
25 silly fetch manifest @apollo/client@*
26 timing arborist:ctor Completed in 0ms
27 http fetch GET 304 https://registry.npmjs.org/@apollo%2fclient 910ms (from cache)
28 silly fetch manifest graphql@^14.0.0 || ^15.0.0
29 http fetch GET 304 https://registry.npmjs.org/graphql 68ms (from cache)
30 silly placeDep ROOT @apollo/client@3.2.5 OK for: client@0.1.0 want: *
31 silly placeDep ROOT graphql@15.4.0 OK for: @apollo/client@3.2.5 want: ^14.0.0 || ^15.0.0
32 timing idealTree Completed in 1588ms
33 timing command:install Completed in 1590ms
34 verbose stack TypeError: Cannot read property 'matches' of undefined
34 verbose stack at Arborist.[canPlaceDep] (/Users/************/.nvm/versions/node/v15.0.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1284:15)
34 verbose stack at Arborist.[placeDep] (/Users/************/.nvm/versions/node/v15.0.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1061:36)
34 verbose stack at Arborist.[placeDep] (/Users/************/.nvm/versions/node/v15.0.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1212:41)
34 verbose stack at /Users/************/.nvm/versions/node/v15.0.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:766:46
34 verbose stack at Array.map (<anonymous>)
34 verbose stack at Arborist.[buildDepStep] (/Users/************/.nvm/versions/node/v15.0.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:766:8)
34 verbose stack at async Arborist.buildIdealTree (/Users/************/.nvm/versions/node/v15.0.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:202:7)
34 verbose stack at async Promise.all (index 1)
34 verbose stack at async Arborist.reify (/Users/************/.nvm/versions/node/v15.0.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
34 verbose stack at async install (/Users/************/.nvm/versions/node/v15.0.1/lib/node_modules/npm/lib/install.js:40:5)
35 verbose cwd /Users/************/dev/twitterlike/client
36 verbose Darwin 19.6.0
37 verbose argv "/Users/************/.nvm/versions/node/v15.0.1/bin/node" "/Users/************/.nvm/versions/node/v15.0.1/bin/npm" "install" "@apollo/client"
38 verbose node v15.0.1
39 verbose npm v7.0.3
40 error Cannot read property 'matches' of undefined
41 verbose exit 1
I tried to search my issue, but I haven't seen anything that change the current situation.
Hope you can help me out. Thank you !
I solved the issue !
I had my bash to automatically update node to the latest version, which in my case was the 15.0.1 (which is including the latest futures). However, it causes some problems when trying to install NOT only @apollo/client, but also @material-ui/core, icons and so on...
So, i switched from my current node version to 14.15.0 (Recommended for most users, as nodejs says) using:
nvm install 14