Coder Social home page Coder Social logo

dl-vampire's Introduction

dl-vampire's People

Contributors

magicdawn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dl-vampire's 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 文件,没有效果。
这个包应该如何正确使用?

proxy support

  • make it easy to use a proxy
  • make a option to use http_proxy / https_proxy / all_proxy env variable, default false

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.