2

As per here npm install web3-eth-accounts should create a dist folder. But i don't see any dist folder being created. Can someone please help me?

  • did you run the build command as well? the dist files are made once you build the project – Achala Dissanayake Sep 26 '17 at 2:13
  • @AchalaDissanayake npm run-script build-all give following error - npm ERR! path /home/user/web3accounts3/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open '/home/user/web3accounts3/package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! /home/user/.npm/_logs/2017-09-26T20_13_48_288Z-debug.log – AntiNatalist Sep 26 '17 at 20:16
  • should I be renaming package-lock.json to package.json before running the command to build the project? – AntiNatalist Sep 26 '17 at 20:19
  • did you go to the repository linked there. I see a dist folder there with a commit message "build files" which are normally gitignored – Achala Dissanayake Sep 27 '17 at 17:48
  • The one in the repository does not have this file dist/web3-eth-accounts.js ... there must be an easier way to create, sign and manage accounts through web3 than this, I don't believe I am doing rocket science here am i. – AntiNatalist Sep 27 '17 at 18:40
2

You need to build your project to get the dist folder, which contains the compiled code. So the npm run-script build-all will create the dist folder as it's mentioned in the link you referred.

To get a understanding about dist folder, you my refer here.

The shortform dist stands for distributable and refers to a directory where files will be stored that can be directly used by others without the need to compile or minify the source code that is being reused.

Example: If I want to use the source code of a Java library that someone wrote, then you need to compile the sources first to make use of it. But if a library author puts already the precompiled version into the repository, then you can just go ahead. Such an already compiled version is saved into the dist directory.

  • npm ERR! path /home/user/web3accounts3/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open '/home/user/web3accounts3/package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! /home/user/.npm/_logs/2017-09-26T20_13_48_288Z-debug.log – AntiNatalist Sep 26 '17 at 20:18
  • 1
    @AntiNatalist if the answer was any help please accept it, or provide your own answer. That's a good practice in SE community. – ETHER Jul 8 '18 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.