Ask a Question
Back to All

I can't seem to run npm install pinata-sdk@latest

I want to be able to use the function await pinata.getHttpUrlForIPFS(tokenCid);

Seems that I need to down load v 3.0 of Pinata. But when I run the install command, npm install pinata-sdk@latest --save under Node 18 I get a bunch of error. Here is the call stack. Help?

reselbob@bobs-mac-mini website % npm install pinata-sdk@latest --save
npm WARN deprecated [email protected]: Please use @electron/get moving forward.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /Users/reselbob/Projects/Create-Tokengate-Demo/website/node_modules/bs-platform
npm ERR! command failed
npm ERR! command sh -c node scripts/install.js
npm ERR! ninja binary is copied from pre-distribution
npm ERR! checkoutput: The OCaml compiler, version BuckleScript 4.0.18 (Using OCaml4.02.3+BS )
npm ERR! Standard library directory: /Users/reselbob/Projects/Create-Tokengate-Demo/website/node_modules/bs-platform/lib/ocaml
npm ERR! 
npm ERR! Prebuilt compiler works good
npm ERR! [1/6] cp bsb_helper.darwin bsb_helper.exe
npm ERR! [2/6] cp bsb.darwin bsb.exe
npm ERR! [3/6] cp bsppx.darwin bsppx.exe
npm ERR! [4/6] cp reactjs_jsx_ppx_2.darwin reactjs_jsx_ppx_2.exe
npm ERR! [5/6] cp bsc.darwin bsc.exe
npm ERR! [6/6] cp refmt.darwin refmt.exe
npm ERR! Cleaning... 0 files.
npm ERR! [1/296] runtime/bs_stdlib_mini.mli -> runtime/bs_stdlib_mini.cmi
npm ERR! [2/296] runtime/js.ml -> runtime/js.cmj runtime/js.cmi
npm ERR! Building runtime/js.ml
npm ERR! File "js_implementation.ml", line 138, characters 33-40 Compilation fatal error, stacktrace saved into bsc.dump when compiling runtime/js.ml
npm ERR! File "/Users/reselbob/Projects/Create-Tokengate-Demo/website/node_modules/bs-platform/jscomp/runtime/js.ml", line 1:
npm ERR! Error: I/O error: /Users/reselbob/Projects/Create-Tokengate-Demo/website/node_modules/bs-platform/lib/amdjs/js.js: No such file or directory
npm ERR! node:child_process:924
npm ERR!     throw err;
npm ERR!     ^
npm ERR! 
npm ERR! Error: Command failed: /Users/reselbob/Projects/Create-Tokengate-Demo/website/node_modules/bs-platform/lib/ninja.exe -f release.ninja
npm ERR!     at checkExecSyncError (node:child_process:885:11)
npm ERR!     at Object.execFileSync (node:child_process:921:15)
npm ERR!     at buildLibs (/Users/reselbob/Projects/Create-Tokengate-Demo/website/node_modules/bs-platform/scripts/install.js:240:8)
npm ERR!     at Object.<anonymous> (/Users/reselbob/Projects/Create-Tokengate-Demo/website/node_modules/bs-platform/scripts/install.js:271:1)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1254:14)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1117:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:958:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
npm ERR!   status: 1,
npm ERR!   signal: null,
npm ERR!   output: [ null, null, null ],
npm ERR!   pid: 37476,
npm ERR!   stdout: null,
npm ERR!   stderr: null
npm ERR! }
npm ERR! 
npm ERR! Node.js v18.16.0

npm ERR! A complete log of this run can be found in: /Users/reselbob/.npm/_logs/2023-11-07T22_40_15_747Z-debug-0.log
reselbob@bobs-mac-mini website %