2

i synced all etherum node in my localhost and i am connecting my node through this command

geth --rpc --rpcaddr "127.0.0.1" --rpcport "8545" \ --rpc --rpccorsdomain "http://127.0.0.1:8545" console

and then i am attaching thought this command from node.js cmd

geth attach http://127.0.0.1:8545 

then i download web3.js and make one html page for testing so before i create account through (geth account new ) from node.js cmd and when and after that i am using some script for checking my create account that is i create thought node.js cmd using (geth account new ) its show perfectly and now i want to create new etherum account using

var Accounts = require('web3-eth-accounts');

// Passing in the eth or web3 package is necessary to allow retrieving chainId, gasPrice and nonce automatically
// for accounts.signTransaction().
var accounts = new Accounts('ws://localhost:8546');

so its showing me error that is

web3-eth-accounts is not found

but you give me solution for this using this command(npm install web3-eth-accounts ) so its successfully install but when i run this (npm run-script build-all) so its not working my my node.js cmd and tell me where i had to run this command in project ? ..

and i am aslo facing this issue

npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

audited 118883 packages in 29.686s
found 1766 vulnerabilities (1 low, 1765 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details
  • 1
    Based on some discussion in other threads, you mentioned you are trying to create an Ethereum account to be used in Web3.js. Is there a reason you are trying to do this programmatically versus using a wallet like MetaMask? This is the standard practice, and makes it really easy to set up a Web3.js front-end. Try looking at this hello world tutorial. – Shawn Tabrizi Aug 29 '18 at 2:44
  • getting balance is working fine but when i am trying to create the new account through html page its giving me error – Awais sakhi Aug 29 '18 at 18:10
  • can we create etherum account using html page like we are using html page for checking balance using some scripts – Awais sakhi Aug 29 '18 at 18:13
  • You can, but I think that is the wrong practice. You should be letting another service like MetaMask create the accounts for the user. Can you tell me why YOU want to create an account using an HTML page? – Shawn Tabrizi Aug 29 '18 at 18:47
  • because i want to make web wallet where i can able to send coin ethereum to ethereum – Awais sakhi Aug 30 '18 at 5:54
1

Follow the installation instructions for web3-eth-accounts:

https://www.npmjs.com/package/web3-eth-accounts

Installation

Node.js

npm install web3-eth-accounts

In the Browser

Build running the following in the web3.js repository:

npm run-script build-all

Then include dist/web3-eth-accounts.js in your html file. This will expose the Web3EthAccounts object on the window object.

  • E:\btc1\web3.js-develop>npm run-script build-all npm ERR! missing script: build-all npm ERR! npm ERR! Did you mean this? npm ERR! build – Awais sakhi Aug 28 '18 at 20:38
  • What are you trying to do? What are you starting with? Are you using Node.js or are you building a basic HTML/JS page? You can't just paste error messages at us. Update your main post to include more details for better advice. – Shawn Tabrizi Aug 28 '18 at 20:49
  • npm run-script build-all when i am try to install this i face issue in my web3 project help me – Awais sakhi Aug 28 '18 at 21:37
  • 1
    The error message for the NPM error says missing script: build-all. Most probably, there is no build-all script defined in the package.json file – Ajoy Bhatia Aug 28 '18 at 23:28
  • @AjoyBhatia could you tell how to add it? – sapiensapiens Sep 10 '18 at 15:55
1

Installing web3-eth-accounts will probably not give a successful build because some other NodeJS module dependency may be missing. So, first execute the following command:

npm install

This takes the list of required dependencies from the package.json file and installs them all.

Also, I looked at the package.json file at https://github.com/ethereum/web3.js/blob/develop/package.json and I don't see a script named build-all defined in it. Look at the "scripts" JSON object in this file. The only scripts you can run (with the command: npm run-script <script-name>) are build, watch, lint, test and test-coveralls. What you want to run is, probably, the following:

npm run-script build

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.