'node.js:TypeError: Cannot read properties of null (reading 'matches')
I run npm install canvas png-js date-fns axios crypto-js ts-md5 tslib @types/node dotenv typescript fs require tslib prettytable jsdom tough-cookie [email protected] jieba fs form-data json5 global-agent
and it turns
TypeError: Cannot read properties of null (reading 'matches')
I read the log file:
TypeError: Cannot read properties of null (reading 'matches') at Link.matches
And I read the specific address in node.js
// if they're links, they match if the targets match
if (this.isLink) {
return node.isLink && this.target.matches(node.target)
}
So,what should I do now? Thanks a lot.
I tried
rm -rf node_modules
rm -rf package-lock.json
and get
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! dev react@"17.x" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@">=15.5 <=16.x" from [email protected]
npm ERR! node_modules/react-codemirror2
npm ERR! dev react-codemirror2@"^7.2.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-05-21T18_20_25_868Z-debug-0.log
I run npm install react-codemirror2 --legacy-peer-deps
and got
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated @types/[email protected]: This is a stub types definition. history provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
added 1686 packages, and audited 1687 packages in 4m
100 packages are looking for funding
run `npm fund` for details
13 vulnerabilities (3 moderate, 10 high)
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
Then what should I do...
# npm audit report
ansi-html <0.0.8
Severity: high
Uncontrolled Resource Consumption in ansi-html - https://github.com/advisories/GHSA-whgm-jr23-g3j9
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/ansi-html
@umijs/preset-built-in <=3.5.24
Depends on vulnerable versions of @umijs/bundler-webpack
Depends on vulnerable versions of ansi-html
Depends on vulnerable versions of mime
node_modules/@umijs/preset-built-in
umi 3.4.0-beta.1 - 3.5.24
Depends on vulnerable versions of @umijs/bundler-webpack
Depends on vulnerable versions of @umijs/preset-built-in
node_modules/umi
async <2.6.4
Severity: high
Prototype Pollution in async - https://github.com/advisories/GHSA-fwr7-v2mv-hh25
No fix available
node_modules/nedb/node_modules/async
nedb *
Depends on vulnerable versions of async
Depends on vulnerable versions of binary-search-tree
node_modules/nedb
mime <1.4.1
Severity: moderate
Regular Expression Denial of Service in mime - https://github.com/advisories/GHSA-wrvr-8mpx-r7pp
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/@umijs/preset-built-in/node_modules/mime
node-fetch <=2.6.6
Severity: high
node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor - https://github.com/advisories/GHSA-r683-j2x4-v87g
The `size` option isn't honored after following a redirect in node-fetch - https://github.com/advisories/GHSA-w7rc-rwvf-8q5r
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/isomorphic-fetch/node_modules/node-fetch
isomorphic-fetch 2.0.0 - 2.2.1
Depends on vulnerable versions of node-fetch
node_modules/isomorphic-fetch
umi-request >=1.2.4-beta.0
Depends on vulnerable versions of isomorphic-fetch
node_modules/umi-request
postcss <=7.0.35
Severity: moderate
Regular Expression Denial of Service in postcss - https://github.com/advisories/GHSA-hwj9-h5mp-3pm3
Regular Expression Denial of Service in postcss - https://github.com/advisories/GHSA-566m-qj78-rww5
fix available via `npm audit fix --force`
Will install [email protected], which is a breaking change
node_modules/postcss
@umijs/bundler-webpack <=3.5.24
Depends on vulnerable versions of postcss
node_modules/@umijs/bundler-webpack
underscore 1.3.2 - 1.12.0
Severity: high
Arbitrary Code Execution in underscore - https://github.com/advisories/GHSA-cf4h-3jhx-xvhq
No fix available
node_modules/underscore
binary-search-tree *
Depends on vulnerable versions of underscore
node_modules/binary-search-tree
13 vulnerabilities (3 moderate, 10 high)
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
