solana-labs / solana-web3.js

Solana JavaScript SDK
https://solana-labs.github.io/solana-web3.js
MIT License
2.2k stars 873 forks source link

Solana web3.js is not getting installed #3252

Closed 0xCipherCoder closed 1 month ago

0xCipherCoder commented 2 months ago

Overview

I have been trying to install Solana web3.js but it's not getting installed. I tried with both npm and yarn.

Steps to reproduce

Try using the below command for npm -

npm install --save @solana/web3.js

This command gets stuck, doesn't progress, and no output is shown.

(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ idealTree:anchor-rpg: sill idealTree buildDeps
(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠧ idealTree:anchor-rpg: sill idealTree buildDeps
(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ idealTree:anchor-rpg: sill idealTree buildDeps
(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ idealTree:anchor-rpg: sill idealTree buildDeps
(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠸ idealTree:anchor-rpg: sill idealTree buildDeps

Try using the below command for yarn -

yarn add @solana/web3.js

It gives the following output -

[1/4] Resolving packages...
⠁ (node:2965134) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.78.4.tgz: certificate is not yet valid".

Description of bug

Node version - v21.7.1 yarn Version - 1.22.19 npm Version - 10.5.0

buffalojoec commented 1 month ago

Strange, it doesn't look like we ever published a version for 1.78.4. I'm not sure where Yarn is getting that patch version from. https://www.npmjs.com/package/@solana/web3.js?activeTab=versions

I just tried to reproduce, and I have no issues installing it, however NPM version 10.2.3 installs @solana/web3.js version 1.95.3 (latest v1 release) on a completely empty repository.

I think it's probably more helpful if you share some context like a package.json, but this seems to me like your local setup is caching that erroneous version somewhere, for some reason.

0xCipherCoder commented 1 month ago

Please find below a package.json file. This is version published as I see in the version list. I initially was trying to install the helpers package but that got stuck due to the web3.js package and then I tried to install that independently. But the same issue is faced. I tried with multiple versions but npm gets stuck and yarn can produce the above output.

Example command tried -

npm install @solana/web3.js@1.95.3
{
  "scripts": {
    "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
    "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
  },
  "dependencies": {
    "@coral-xyz/anchor": "^0.30.1"
  },
  "devDependencies": {
    "@types/bn.js": "^5.1.0",
    "@types/chai": "^4.3.0",
    "@types/mocha": "^9.1.1",
    "chai": "^4.3.4",
    "mocha": "^9.2.2",
    "prettier": "^2.6.2",
    "ts-mocha": "^10.0.0",
    "typescript": "^4.3.5"
  }
}
0xCipherCoder commented 1 month ago

This looks like a local issue running WSL Ubuntu as after restarting the system it started working.

github-actions[bot] commented 1 month ago

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.