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

Where is dist folder and web3.min.js? #1041

Closed
nyxynyx opened this issue Sep 14, 2017 · 30 comments
Closed

Where is dist folder and web3.min.js? #1041

nyxynyx opened this issue Sep 14, 2017 · 30 comments

Comments

@nyxynyx
Copy link

nyxynyx commented Sep 14, 2017

After npm install --save web3, I only see packages and src foldesr inside node_modules/web3. Where is the dist folder containing web3.min.js?

@riteable
Copy link

riteable commented Sep 15, 2017

Same issue here when installing with npm. No dist folder. Thought I'd try npm run build, but there's an error: "Local gulp not found in ...". While I do have gulp installed globally.

@riteable
Copy link

riteable commented Sep 15, 2017

I should add that using import Web3 from 'web3' (in Nuxt.js) gives an error for missing dependencies:

These dependencies were not found:

* eth-lib/lib/hash in ./node_modules/web3/packages/web3-utils/src/utils.js
* ethjs-unit in ./node_modules/web3/packages/web3-utils/src/index.js
* number-to-bn in ./node_modules/web3/packages/web3-utils/src/utils.js
* randomhex in ./node_modules/web3/packages/web3-utils/src/index.js
* swarm-js in ./node_modules/web3/packages/web3-bzz/src/index.js
* underscore in ./node_modules/web3/packages/web3-bzz/src/index.js, ./node_modules/web3/packages/web3-eth/src/index.js and 4 others
* web3-core in ./node_modules/web3/packages/web3-eth-personal/src/index.js, ./node_modules/web3/packages/web3-eth/src/index.js and 2 others
* web3-core-helpers in ./node_modules/web3/packages/web3-core/src/extend.js, ./node_modules/web3/packages/web3-eth-personal/src/index.js and 1 other
* web3-core-method in ./node_modules/web3/packages/web3-core/src/extend.js, ./node_modules/web3/packages/web3-eth-personal/src/index.js and 3 others
* web3-core-requestmanager in ./node_modules/web3/packages/web3-core/src/index.js
* web3-core-subscriptions in ./node_modules/web3/packages/web3-eth/src/index.js, ./node_modules/web3/packages/web3-shh/src/index.js
* web3-eth-abi in ./node_modules/web3/packages/web3-eth/src/index.js
* web3-eth-accounts in ./node_modules/web3/packages/web3-eth/src/index.js
* web3-eth-contract in ./node_modules/web3/packages/web3-eth/src/index.js
* web3-eth-iban in ./node_modules/web3/packages/web3-eth/src/index.js
* web3-eth-personal in ./node_modules/web3/packages/web3-eth/src/index.js
* web3-net in ./node_modules/web3/packages/web3-eth-personal/src/index.js, ./node_modules/web3/packages/web3-eth/src/index.js and 1 other
* web3-utils in ./node_modules/web3/packages/web3-core/src/extend.js, ./node_modules/web3/packages/web3-eth-personal/src/index.js and 2 others

To install them, you can run: npm install --save eth-lib/lib/hash ethjs-unit number-to-bn randomhex swarm-js underscore web3-core web3-core-helpers web3-core-method web3-core-requestmanager web3-core-subscriptions web3-eth-abi web3-eth-accounts web3-eth-contract web3-eth-iban web3-eth-personal web3-net web3-utils

@frozeman
Copy link
Contributor

@riteable npm run-script build should work. And why is it not installing those dependencies? They are in the package.json and testing it locally works. Can you give more information?

@ghost
Copy link

ghost commented Sep 23, 2017

I also have this issue: no dist folder after running npm install web3 --save.

My mac has node v8.5.0 and npm v5.4.2.

Thanks in advance for any insight!

@okwme
Copy link

okwme commented Sep 25, 2017

after running npm install web3@1.0.0-beta2 --save i'm missing utils functions.

i went into /node_modules/web3/ and ran npm install and npm run-script build but i get the install error:
Error: Cannot find module 'web3-core' from '[my_project_path]/node_modules/web3/packages/web3-net/src'

@riteable
Copy link

riteable commented Oct 2, 2017

@frozeman Now it seems to install even less files than previously. When I npm install web3 and view my node_modules/web3 directory there's only a src directory, and package.json and README.md files. I assume there should be a lot more there, like dist, packages, lib directories, etc.

Also, package.json doesn't have a scripts field where the build command is defined, so npm run-script build will not work inside the web3 directory.

This happens using OS X and web3@1.0.0-beta.22. Later today I will test on Ubuntu and report back.

@wrisx
Copy link

wrisx commented Oct 8, 2017

Same problem here

@anaamnizami
Copy link

I am facing the same issue on Ubuntu. Has anyone figured out the solution?

@anaamnizami
Copy link

@nyxynyx hey so basically along with npm install web3 you also need "npm install ethereum/web3.js" . This worked for me

@byjg
Copy link

byjg commented Nov 17, 2017

If you wanna create the dist/web3.js you'll have to do this directly from the source code.

git clone git@github.com:ethereum/web3.js
git checkout 1.0
npm install
npm run-script build

@adibas03
Copy link

adibas03 commented Dec 4, 2017

What worked for me.
If web.0.x.x ,
import 'web3/index'

@Aliasgharmohammad
Copy link

hi guys i solved this issue by downloading the offline package from https://codeload.github.com/ethereum/web3.js/zip/develop and unzipped dist part from it and moved it to the directory where web3 was installed and added where it must be .

@k06a
Copy link

k06a commented Mar 8, 2018

Just discovered tag 1.0. Here is always actual latest dist: https://github.com/ethereum/web3.js/blob/1.0/dist/web3.min.js

gasolin added a commit to gasolin/web3.js that referenced this issue Apr 21, 2018
gasolin added a commit to gasolin/web3.js that referenced this issue Apr 21, 2018
@gasolin
Copy link

gasolin commented Apr 21, 2018

Since web3 1.x package is published via packages/web3 and dist/ is not there.
I made a patch at #1336 to put the dist/web3.min.js to the right place.

@yidongw
Copy link

yidongw commented Jul 4, 2018

@k06a Thanks so much. It was really difficult to find the 1.0 version

@masterial
Copy link

I have this problem. >:(

@frozeman
Copy link
Contributor

frozeman commented Jul 22, 2018

The dist folder is in the 1.0 branch: https://github.com/ethereum/web3.js/tree/1.0/dist

@nivida nivida closed this as completed Aug 9, 2018
@igormuba
Copy link

igormuba commented Feb 1, 2019

still have this problem, isn't there any alternative to web3 to work with Ethereum?!?!

@bolpol
Copy link

bolpol commented Feb 4, 2019

Of coursce if you need 1.x.x version just use /dist/web3.esm.js, minify it use Free Online Javascript Minifier

@bolpol
Copy link

bolpol commented Feb 4, 2019

still have this problem, isn't there any alternative to web3 to work with Ethereum?!?!

Use this library ethers.js, wrapper for web3

@oberstet
Copy link

oberstet commented Mar 8, 2019

npm install ethereum/web3.js did work for me (I get a distfolder with web3.min.js) - NOT npm install web3

@mcplums
Copy link

mcplums commented Mar 28, 2019

I tried npm install ethereum/web3.js and did NOT get a dist folder with web3.min.js... the links above with the online version of this file are all 404ing

@Jorocha
Copy link

Jorocha commented Mar 29, 2019

web3@0.20.6 --save

Thanks! This works for me too!

@AndreGidoin
Copy link

Why isn't the dist folder with the most up to date web3.js file just added here? It makes it really hard to understand what's wrong and where to find the right files needed.

@JesseBusman
Copy link

I'm having this problem, nothing mentioned here has helped me get a web3.min.js.

@AdaptiveGitHuber
Copy link

@1559012
Your solution really helps. In my case, in Windows 10, nothing worked until I UNINSTALL the nodes first:
npm uninstall -g web3

Then

install the build tools and reinstall web3 as in steps 2. and 3. @1559012
Thank you so much!

@andy0130tw
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests