Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.7.2 published on npm does not have the lib/index.js file #4926

Closed
1 task done
guenoledc opened this issue Apr 7, 2022 · 7 comments
Closed
1 task done
Labels
1.x 1.0 related issues Bug Addressing a bug

Comments

@guenoledc
Copy link

guenoledc commented Apr 7, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

as of 8th March 2022 1am CET

npm install web3

install version 1.7.2 that does not have the lib folder but the package.json points to lib/index.js

running

const web3 = require("web3")

produce the error

node:internal/modules/cjs/loader:361
      throw err;
      ^

Error: Cannot find module '/...../test/node_modules/web3/lib/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:353:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/Users/guenole/VSCode/CryptoPixelWar/test/index.js:1:14)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/Users/guenole/VSCode/CryptoPixelWar/test/node_modules/web3/package.json',
  requestPath: 'web3'
}

Expected Behavior

Expect the lib folder to be present in the downloaded package like it worked with 1.7.1

doing

npm install web3@1.7.1

running

const web3 = require("web3")

works well

Steps to Reproduce

npm install web3@1.7.2

const web3 = require("web3")

Web3.js Version

1.7.2

Environment

  • Operating System: Mac Os
  • Browser: N/A
  • Node.js Version: v16.8.0
  • NPM Version: 8.1.3

Anything Else?

All web3-* modules suffer the same problem

Please correct as it is a breaking change for the compilation stack

Thanks

@guenoledc guenoledc added the Bug Addressing a bug label Apr 7, 2022
@Darren120
Copy link

Darren120 commented Apr 7, 2022

+1 i try downgrading and also no work

1.6.0 works.

@jdevcs
Copy link
Contributor

jdevcs commented Apr 7, 2022

Thanks @guenoledc , we will publish patch.
could you reproduce this issue with 1.7.3-rc.0?

@IrfanAli17899
Copy link

i am also getting this error

@IrfanAli17899
Copy link

i am getting this error for web3-utils too.
image

@jdevcs
Copy link
Contributor

jdevcs commented Apr 7, 2022

@IrfanAli17899 could you check with 1.7.3-rc.0 ( use this in package and package lock files )

@jdevcs jdevcs added the 1.x 1.0 related issues label Apr 7, 2022
@jdevcs
Copy link
Contributor

jdevcs commented Apr 8, 2022

1.7.3 has fix for this issue, so closing.

@jdevcs jdevcs closed this as completed Apr 8, 2022
@guenoledc
Copy link
Author

Hello, Thanks for the prompt action.
I confirmed it is fixed with npm i web3

It now takes v 1.7.3 that contains the lib folder.

Thanks for the great lib guys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests

4 participants