- 創建web3_test目錄:

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 web3@0.20.1 --save-dev
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN web3_test@1.0.0 No description
npm WARN web3_test@1.0.0 No repository field.
+ web3@0.20.1
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
web3_test@1.0.0 /home/jiahuan/project/web3_test
└── web3@0.20.1
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/261021.html
標籤:區塊鏈
上一篇:Pi幣新手須知(常見問題)
下一篇:以太坊智能合約
