Issues with @solana/spl-tokens pnpm is not saving this package to where I can't connect to the blockchain with the .js file I created like: #5902
Labels
question
Further information is requested
const { Token, TOKEN_PROGRAM_ID } = require("@solana/spl-token");
const { Connection, PublicKey, Keypair } = require("@solana/web3.js");
async function main() {
// Your existing mint, payer, and recipient details
const mintPublicKey = new PublicKey("");
const recipientTokenAccount = new PublicKey("");
const payerKeypair = Keypair.generate(); // Your account that will pay for the transaction
}
main().catch(err => {
console.error("Error executing the script:", err);
});
After running pnpm install @solana/spl-tokens, I get still:
node:internal/modules/cjs/loader:1147
throw err;
^
Error: Cannot find module '@solana/spl-token'
Require stack:
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object. (/mnt/c/Users/segura23/SeguraSafeSwap_Token/SeguraSafeSwap_Solana3/solana-program-library/services/js/blockchainConnection.js:1:37)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/mnt/c/Users/segura23/SeguraSafeSwap_Token/SeguraSafeSwap_Solana3/solana-program-library/services/js/blockchainConnection.js'
]
}
Node.js v21.2.0
The text was updated successfully, but these errors were encountered: