'How to use nft.storage library in Angular 11 project
I have an Angular project in which I'm trying to use nft.storage library. But I'm getting the following errors in Angular Cli:
Error: ./node_modules/nft.storage/src/platform.web.js
Module not found: Error: Can't resolve 'ipfs-car/blockstore/memory' in '/home/newsha/Newsha/sonido-project/Sonido-front/node_modules/nft.storage/src'
Error: ./node_modules/nft.storage/src/lib.js
Module not found: Error: Can't resolve 'ipfs-car/pack' in '/home/newsha/Newsha/sonido-project/Sonido-front/node_modules/nft.storage/src'
Error: ./node_modules/nft.storage/src/token.js
Module not found: Error: Can't resolve 'ipfs-car/pack' in '/home/newsha/Newsha/sonido-project/Sonido-front/node_modules/nft.storage/src'
I installed the package using npm and then imported it in the project like this:
import { NFTStorage, File } from 'nft.storage'
import { pack } from 'ipfs-car/pack';
const apiKey = 'MY_API_KEY'
const client = new NFTStorage({ token: apiKey })
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
