-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Can't install web3 version 1.2 on Windows 10 #2971
Comments
I have encountered the same problem
Versions
|
This is because package |
To clarify what @filips123 said: This is a bug in |
@levino Why does package need to delete |
I was not talking about a fix. I was talking about the status quo: You cannot install this package on Windows atm. I do not know why there is a preinstall script and I have not looked into how this can be fixed. Your analysis above sounds right. I just wanted to clarify that this is a bug that needs to be fixed here. One could read your comment like instructions for a workaround, which they are not. |
The preinstall script is a red herring, and isn't needed; it should be removed from There's a nasty bug in npm that's fixed in 6.10.1: https://npm.community/t/installing-with-git-url-results-in-spurious-git-directory-within-node-modules/8815. (this after-effects of this bug can manifest weird behavior on Windows like not being able to delete sudirs in To overcome this problem, you may need to do a combination of the following, or all of them:
|
On Windows I found I had to upgrade to the latest npm ( |
Not really an idea solution if i have to upgrade npm since it comes with nodejs LTS version. |
|
@devedse the screenshot helped me understand, thank you! @taducquang I apologize for a bit of misdirection in my previous replies. Indeed, I've kept a Windows laptop (or at least a VM) around for cross-platform testing the past couple of years, but one of the first things I do when setting up a Windows environment is install tools like cmder and Git for Windows (note: there is a cmder download that bundles the two things). That makes *nix commands like So the "fix" in this case will be to remove the preinstall script from As for the npm bug I linked to earlier — it's a real thing over which web3 has no control and there's no easy way to get around it other than for users to upgrade their npm, sorry @taducquang. Maybe web3 1.x can switch to using a websocket version that's downloaded from the registry (change already made in web3 2.x), but I think there's still some problem whereby web3 1.x needs to install the version directly from github — it's the install from github that triggers the bug. Note that on linux/macOS using a |
@sabby19 after discussing with @nivida the plan is to switch from the In the meantime, you can install the Cmder bundle that includes Git for Windows. Also, you will need to upgrade to the latest npm ( |
@michaelsbradleyjr, as part of integration testing / builds / etc. it might be a good idea to setup a TravisCI build to do a clean NPM install (from source) for Web3.js and the same for AppVeyor. That will help catch issues like this in an early stage. |
Yeah. Or one might start having some integration tests first... |
Oh |
The `michaelsbradleyjr/Websocket-Node#polyfill/globalThis` branch uses a more robust approach to resolve a browser's `window` object. It also includes all the latest commits on the upstream's `master` branch, including fixes for the `.git/` subdir npm bug and Node v12.x compatibility. The `"preinstall"` script in `packages/web3-providers-ws/package.json` is removed because it's not helpful and its use of `rm` causes Windows incompatibility. Closes web3#2971 and web3#2973. `packages/web3-providers-ws/src/index.js` is refactored since the `websocket` package already does native WebSocket detection.
The `michaelsbradleyjr/Websocket-Node#polyfill/globalThis` branch uses a more robust approach to resolve a browser's `window` object. It also includes all the latest commits on the upstream's `master` branch, including Node v12.x compatibility and a workaround for the `.git/` subdir npm bug. The `"preinstall"` script in `packages/web3-providers-ws/package.json` is removed because it's not helpful and its use of `rm` causes Windows incompatibility. Closes web3#2971 and web3#2973. `packages/web3-providers-ws/src/index.js` is refactored since the `websocket` package already does native WebSocket detection.
Fixed with #2976 |
@nivida, can I retest this issue already using some kind of beta NPM source? Or do I have to wait for the next release? |
@nivida When it will be released? |
Possibly there should be a release day like every monday or so where there is a release of latest master if changes were merged. |
@levino, I'd rather have nightly builds with a beta release path and let the package maintainers decide on when to release master to production. Else you could end up with 'semi broken' or 'not finished' versions of the package getting released to NPM. |
@devedse I agree with that. But there is no need to create nightly releases. Users who want to try the latest unreleased changes can just require Web3 directly from GitHub: {
"dependencies": {
"web3": "github:ethereum/web3.js#1.x"
}
} |
No you cant. This is a lerna monorepo. How on earth could that work? |
@levino I forgot that... Maybe lerna has some features for that? |
No it does not. One has to publish the package to npm. There is no workaround. I for my part just publish it to @levino/web3.js which is a nightmare because I have to update and publish all subpackages too. |
Sorry, but that approach is very wrong. |
@levino, if you can make sure that every change being merged to master has been fully tested and is ready for production I'd agree. From my experience most master branches are used for 'Beta' versions as well. Once the beta version is stabilized, a release will be made. Take for example the change that was just merged to master. I'm sure this has been tested on local environments but as there are no integration tests nor has it been tested by the mass I wouldn't specifically call this to be "Fully tested". It's up to the maintainers to make a choice in this of course, and I agree that it would be ideal to autopublish on merge to master. But in my oppinion that publish should only ever be a beta release rather then a full fledged new version. (E.g. think about the way Microsoft handles different versions of releasing windows. You can choose between different insider tracks depending on whether you want the latest "Master" build or rather have the more tested "Release") Edit: This discussion is probably going too far off-topic anyway :). Let's hope we can release the new version of web3.js asap. |
Or one just releases it and sees who has a problem. People use |
@levino, I think we both agree on the problem. Nobody is testing their stuff before it's published. Regarding the best practical solution I agree that simply releasing it and hoping that issues get found quickly is probably one of the more easy solutions to implement. Let's leave it at that 😄 |
You guys can use git bash for install [email protected] |
Please elaborate |
|
Git Bash solved the issue for me in Windows |
Do it with Git Bash |
The `michaelsbradleyjr/Websocket-Node#polyfill/globalThis` branch uses a more robust approach to resolve a browser's `window` object. It also includes all the latest commits on the upstream's `master` branch, including Node v12.x compatibility and a workaround for the `.git/` subdir npm bug. The `"preinstall"` script in `packages/web3-providers-ws/package.json` is removed because it's not helpful and its use of `rm` causes Windows incompatibility. Closes web3#2971 and web3#2973. `packages/web3-providers-ws/src/index.js` is refactored since the `websocket` package already does native WebSocket detection.
Hi, i don't know why but seem like i can't install web3's latest version even on new project on Windows 10.
Command:
npm install web3 or yarn add web3
Details of Error:
Versions
The text was updated successfully, but these errors were encountered: