个人学习 / 代码 / 总结 / 读书笔记, 请勿参与评论. see Issues
magicdawn / dl-vampire Goto Github PK
View Code? Open in Web Editor NEWDownload file like a vampire
License: MIT License
Download file like a vampire
License: MIT License
个人学习 / 代码 / 总结 / 读书笔记, 请勿参与评论. see Issues
我在尝试写一个小型测试:
import dl from 'dl-vampire'
...
dl({
url: URL,
file: FILENAME
})
编译报错
tsc main.ts
node_modules/.pnpm/[email protected]/node_modules/dl-vampire/dist/index.d.ts:3:8 - error TS1259: Module '"events"' can only be default-imported using the 'esModuleInterop' flag
3 import EventEmitter from 'events';
~~~~~~~~~~~~
node_modules/.pnpm/@[email protected]/node_modules/@types/node/events.d.ts:891:5
891 export = EventEmitter;
~~~~~~~~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
node_modules/.pnpm/[email protected]/node_modules/dl-vampire/dist/index.d.ts:4:44 - error TS2307: Cannot find module 'got' or its corresponding type declarations.
There are types at 'PROJECT_PATH/node_modules/.pnpm/[email protected]/node_modules/got/dist/source/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
4 import { OptionsInit, Progress, Got } from 'got';
~~~~~
node_modules/.pnpm/[email protected]/node_modules/dl-vampire/dist/index.d.ts:5:168 - error TS2307: Cannot find module 'got' or its corresponding type declarations.
There are types at 'PROJECT_PATH/node_modules/.pnpm/[email protected]/node_modules/got/dist/source/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
5 export { CacheError, CancelError, HTTPError, MaxRedirectsError, ParseError, Progress, ReadError, RequestError, TimeoutError as RequestTimeoutError, UploadError } from 'got';
~~~~~
node_modules/.pnpm/[email protected]/node_modules/get-uri/dist/http.d.ts:5:8 - error TS1192: Module '"http"' has no default export.
5 import http_ from 'http';
~~~~~
node_modules/.pnpm/[email protected]/node_modules/get-uri/dist/http.d.ts:6:8 - error TS1192: Module '"https"' has no default export.
6 import https from 'https';
~~~~~
node_modules/.pnpm/[email protected]/node_modules/proxy-agent/dist/index.d.ts:3:8 - error TS1259: Module '"PROJECT_PATH/node_modules/.pnpm/[email protected]/node_modules/lru-cache/index"' can only be default-imported using the 'esModuleInterop' flag
3 import LRUCache from 'lru-cache';
~~~~~~~~
node_modules/.pnpm/[email protected]/node_modules/lru-cache/index.d.ts:869:1
869 export = LRUCache
~~~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
Found 6 errors in 3 files.
Errors Files
3 node_modules/.pnpm/[email protected]/node_modules/dl-vampire/dist/index.d.ts:3
2 node_modules/.pnpm/[email protected]/node_modules/get-uri/dist/http.d.ts:5
1 node_modules/.pnpm/[email protected]/node_modules/proxy-agent/dist/index.d.ts:3
ELIFECYCLE Command failed with exit code 2.
后来我搜索了这些错误的相关处理,修改了 tsconfig.json
文件,没有效果。
这个包应该如何正确使用?
http_proxy
/ https_proxy
/ all_proxy
env variable, default falseA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.