首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >node.js:TypeError:无法读取null属性(读取“匹配”)

node.js:TypeError:无法读取null属性(读取“匹配”)
EN

Stack Overflow用户
提问于 2022-05-21 18:10:47
回答 1查看 1.1K关注 0票数 0

我运行npm install canvas png-js date-fns axios crypto-js ts-md5 tslib @types/node dotenv typescript fs require tslib prettytable jsdom tough-cookie ws@7.4.3 jieba fs form-data json5 global-agent,它会转

TypeError:无法读取null属性(读取“匹配”)

我读了日志文件:

TypeError:无法读取Link.matches上的null属性(读取“匹配”)

我在node.js中读到了具体的地址

代码语言:javascript
复制
 // if they're links, they match if the targets match
if (this.isLink) {
  return node.isLink && this.target.matches(node.target)
}

那我现在该怎么办?非常感谢。

我试过了

rm -rf node_modules

rm -rf包-lock.json

并获取

代码语言:javascript
复制
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@17.0.2
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 react-codemirror2@7.2.1
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

我运行npm install react-codemirror2 --legacy-peer-deps

代码语言:javascript
复制
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated @types/history@5.0.0: This is a stub types definition. history provides its own type definitions, so you do not need this installed.
npm WARN deprecated sane@4.1.0: 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.

那我该怎么办..。

代码语言:javascript
复制
 # 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 umi@3.5.3, 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 umi@3.5.3, 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 umi-request@1.2.3, 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 umi@3.5.3, 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.
EN

回答 1

Stack Overflow用户

发布于 2022-08-12 00:03:14

我和react-owl-carousel也有同样的问题。我尝试进入package.json文件并添加:

代码语言:javascript
复制
"overrides": "$react", "$react-dom"

这是行不通的。然后我尝试使用pnpm install,这似乎很好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72332120

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档