upload folder fialed
See original GitHub issuemy program
const fs = require('fs');
const path = require('path');
const pinataSDK = require('@pinata/sdk');
const pinata = pinataSDK(API Key,API Secret);
async function main(){
const imgPath = path.join(__dirname,'..','img')
const files = fs.readdirSync(imgPath)
for(var i = 0;i< files.length;i++){
console.log('Pinning to pinata ....')
const readableStreamForFile = fs.createReadStream(imgPath+`/${files[i]}`);
let result = await pinata.pinFileToIPFS(readableStreamForFile);
hashes.push(result.IpfsHash);
}
}
main();
I get this error when compiling
TypeError: pinataSDK is not a function at Object.<anonymous> (/Users/steven/Documents/Node/src/pin-to-ipfs/scripts/upload.js:4:16) at Module._compile (internal/modules/cjs/loader.js:1137:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1157:10) at Module.load (internal/modules/cjs/loader.js:985:32) at Function.Module._load (internal/modules/cjs/loader.js:878:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47
Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
12 Easy Ways to Fix Google Drive Upload Failed Issue in 2021
This article offers you 12 easy and useful ways to solve upload failure on Google Drive and introduces you an efficient method to...
Read more >"Upload failed" for large folders using Google drive in Chrome ...
"Upload failed" for large folders using Google drive in Chrome browser. I am trying to upload a folder with a lot of subfolders...
Read more >Fix Box Upload Failed for Free | 14 Ways + 2 Tips - CBackup
14 Quick Solutions to Box Upload Failed · Solution 1. Check Box Upload Limit First · Solution 2. Clear Browser's Cache · Solution...
Read more >Google Drive Failed to Upload – What You Can Do - Alphr
Uploading is much more demanding on your network than downloading, and sometimes trying to upload a massive folder all at once can cause...
Read more >How to Solve File Upload Errors in Google Drive - MakeUseOf
To do this, click the Backup and Sync icon in your system tray. Click the Settings icon (three vertical dots) and click Quit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hey @rommel-pinata the version of node I use and the sdk of pinata