以太坊开发:web3js(一)创建web3目录

  1. 创建web3_test目录:

以太坊开发:web3js(一)创建web3目录_第1张图片

jiahuan@ubuntu:~$ cd project
jiahuan@ubuntu:~/project$ ls
myChain  myDevChain
jiahuan@ubuntu:~/project$ mkdir web3_test
jiahuan@ubuntu:~/project$ cd web3_test
jiahuan@ubuntu:~/project/web3_test$ ls
jiahuan@ubuntu:~/project/web3_test$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (web3_test) 
version: (1.0.0) 
description: 
entry point: (index.js) 
test command: 
git repository: 
keywords: 
author: 
license: (ISC) 
About to write to /home/jiahuan/project/web3_test/package.json:

{
     
  "name": "web3_test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
     
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}


Is this OK? (yes) 
jiahuan@ubuntu:~/project/web3_test$ ls
package.json
jiahuan@ubuntu:~/project/web3_test$ npm install [email protected] --save-dev
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 6 packages from 11 contributors in 29.957s
jiahuan@ubuntu:~/project/web3_test$ 
jiahuan@ubuntu:~/project/web3_test$ ls
node_modules  package.json  package-lock.json
jiahuan@ubuntu:~/project/web3_test$ cd node_modules
jiahuan@ubuntu:~/project/web3_test/node_modules$ ls
bignumber.js  crypto-js  utf8  web3  xhr2  xmlhttprequest
jiahuan@ubuntu:~/project/web3_test/node_modules$ npm list web3
[email protected] /home/jiahuan/project/web3_test
└── [email protected] 


你可能感兴趣的:(以太坊)