web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

Where is `dist` folder and `web3.min.js`?

Open nyxynyx opened this issue 9 years ago • 27 comments

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?

nyxynyx avatar Sep 14 '17 21:09 nyxynyx

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 avatar Sep 15 '17 16:09 riteable

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

riteable avatar Sep 15 '17 16:09 riteable

@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?

frozeman avatar Sep 21 '17 11:09 frozeman

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!

ghost avatar Sep 23 '17 13:09 ghost

after running npm install [email protected] --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'

okwme avatar Sep 25 '17 09:09 okwme

@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 [email protected]. Later today I will test on Ubuntu and report back.

riteable avatar Oct 02 '17 11:10 riteable

Same problem here

wrisx avatar Oct 08 '17 18:10 wrisx

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

anaamnizami avatar Oct 09 '17 12:10 anaamnizami

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

anaamnizami avatar Oct 10 '17 10:10 anaamnizami

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

git clone [email protected]:ethereum/web3.js
git checkout 1.0
npm install
npm run-script build

byjg avatar Nov 17 '17 20:11 byjg

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

adibas03 avatar Dec 04 '17 06:12 adibas03

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 .

Aliasgharmohammad avatar Feb 09 '18 19:02 Aliasgharmohammad

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

k06a avatar Mar 08 '18 07:03 k06a

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

gasolin avatar Apr 21 '18 05:04 gasolin

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

yidongw avatar Jul 04 '18 08:07 yidongw

I have this problem. >:(

masterial avatar Jul 22 '18 23:07 masterial

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

frozeman avatar Jul 22 '18 23:07 frozeman

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

igormuba avatar Feb 01 '19 19:02 igormuba

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

ghost avatar Feb 04 '19 07:02 ghost

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

Use this library ethers.js, wrapper for web3

ghost avatar Feb 04 '19 07:02 ghost