Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1K
Visualizações
My Javascript file won't run because of bigint error

I am trying to use @metaplex/js to do some NFT minting. Usually my .js files work properly but when I run the file this error comes up.

bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)

I don't really get what that means. So, I tried to run npm run rebuild but rebuild is said to be a missing script and I couldn't find a way to install it.

Here is my code:

import { Connection, programs} from "@metaplex/js";
import { Loader } from "@solana/web3.js";
const { metadata: {Metadata}} = programs;


const connection = new Connection("devnet");
const tokenPublicKey = 'my_adress';

const run = async() => {
    try{
        const ownedMetadata = await Metadata.Loader(connection,tokenPublicKey)
        console.log(ownedMetadata)
    }
    catch{
        console.log('Failed to fetch')
    }

};

run();

If you have any idea, or simply an explanation of what my error means, I'd be grateful.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You are getting this error because a nested dependency has a compilation step that might not succeed in your platform. This issue provides a good explanation.

[...] This happens because one of our dependencies (bigint-buffer) runs a compilation step on installation and this can step may fail for a couple of reasons. One of the reasons is that your system might not have the build-tools the library is looking for. You can install these build tools on Windows (see https://www.npmjs.com/package/windows-build-tools), but you don't actually need to as it automatically falls back to a pure JS solution instead. Though I agree... that warning is very annoying.

However, this should give you a warning and still allow you to compile your code.

It is worth noting that the current JS SDK from Metaplex is going to be deprecated in favour of the new one: https://github.com/metaplex-foundation/js-next

With the new JS SDK, you can fetch an NFT using the following piece of code.

import { Metaplex } from "@metaplex-foundation/js-next";
import { Connection, clusterApiUrl } from "@solana/web3.js";

const connection = new Connection(clusterApiUrl("mainnet-beta"));
const metaplex = new Metaplex(connection);
const mint = new PublicKey("ATe3DymKZadrUoqAMn7HSpraxE4gB88uo1L9zLGmzJeL");

const nft = await metaplex.nfts().findByMint(mint);
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda