我正在创建一个程序来分析安全摄像头流,但卡在了第一行。目前,我的 .js 文件除了导入 node-fetch 之外什么都没有,它给了我一条错误消息。我究竟做错了什么?
在适用于 Linux 的 Windows 子系统中运行 Ubuntu 20.04.2 LTS。
节点版本:
user@MYLLYTIN:~/CAMSERVER$ node -v
v14.17.6
Run Code Online (Sandbox Code Playgroud)
节点获取包版本:
user@MYLLYTIN:~/CAMSERVER$ npm v node-fetch
node-fetch@3.0.0 | MIT | deps: 2 | versions: 63
A light-weight module that brings Fetch API to node.js
https://github.com/node-fetch/node-fetch
keywords: fetch, http, promise, request, curl, wget, xhr, whatwg
dist
.tarball: https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz
.shasum: 79da7146a520036f2c5f644e4a26095f17e411ea
.integrity: sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==
.unpackedSize: 75.9 kB
dependencies:
data-uri-to-buffer: ^3.0.1 fetch-blob: ^3.1.2
maintainers:
- endless <jimmy@warting.se>
- bitinn <bitinn@gmail.com>
- timothygu <timothygu99@gmail.com>
- akepinski <npm@kepinski.ch>
dist-tags: …Run Code Online (Sandbox Code Playgroud)