Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

337
Views
IPFS Angular11 ipfs-http-client new IpfsHttpClient = Error: exportar 'AbortController', Multiaddr

Hola, tengo un problema con ipsf-http-client usando angular. Al devolver new IpfsHttpClient() , me faltan Multiaddr , anySignal , AbortController y otras exportaciones. También tengo un error: esta expresión no se puede construir, (.../ipfs-http-client/types/src/index")' no construct signatures . Por favor, para obtener sugerencias sobre cómo resolverlo o cómo implementar correctamente ipsf-http -cliente en aplicación angular

 Angular CLI: 12.1.4 Node: 14.17.3 Package Manager: npm 6.14.13 OS: win32 x64 Python: 3.10

dentro de tsconfig:

 "skipLibCheck": true, "target": "es2017", "module": "es2020", "lib": [ "es2018", "dom", "DOM.Iterable", "es2015", "es2015.iterable", ], "paths" : { "crypto": ["./node_modules/crypto-browserify"], "stream": ["./node_modules/stream-browserify"], "assert": ["./node_modules/assert-plus"], "http": ["./node_modules/stream-http"], "https": ["./node_modules/https-browserify"], "os": ["./node_modules/os-browserify"], }, "allowSyntheticDefaultImports": true, "esModuleInterop": true,

A continuación se muestra el token de inicio principal de ipfs.

 import { Injectable, InjectionToken, Inject } from '@angular/core'; import IpfsHttpClient from 'ipfs-http-client'; export const ipfsToken = new InjectionToken('The IPFS Token', { providedIn: 'root', factory: () => { try { return new IpfsHttpClient('ipfs.infura.io', '5001', { protocol: 'https' }); } catch (err) { console.log('Error', err); throw new Error('Unable to access IPFS node daemon on Infura network'); } } });

Puedo evitar un error construible con la solución a continuación, pero aún tengo Missing Multiaddr, anySignal, AbortController y otras exportaciones.

 import { Injectable, InjectionToken, Inject } from '@angular/core'; import IpfsHttpClient from 'ipfs-http-client'; export const ipfsToken = new InjectionToken('The IPFS Token', { providedIn: 'root', factory: () => { let contextClass : any = IpfsHttpClient; let context: IpfsHttpClient.IPFSHTTPClient = new contextClass('ipfs.infura.io', '5001', { protocol: 'https' }); try { console.log("IPFS"); return context; } catch (err) { console.log('Error', err); throw new Error('Unable to access IPFS node daemon on Infura network'); } } });
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Después de 2 días de recibir el molesto Multiaddr , anySignal y AbortController not found en mi proyecto iónico, noté que estaba usando la versión incorrecta del paquete ipfs . Elaborar:

Instalé ipfs con: npm install --save ipfs-http-client (revisé el archivo package.json en el directorio de trabajo del proyecto).

Después de eliminar la sección package.json ipfs y la carpeta node_module , ejecuté npm i ipfs-http-client@52.0.4-rc.4 y reinstalé todos los paquetes usando npm install . Esta vez funcionó sin ningún error.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!