Step1: install truffle
$npm install -g truffle
Step2: install nodejs
$brew install node
Step3: check truffle and node version
$Truffle version
$Node -v
Step4: initial webpack
$Truffle unbox webpack
Step5: compile
$truffle compile
Step6: migrate
$truffle migrate
modify truffle.js to below information and execute again
****************************************************
module.exports = {
networks: {
development: {
host: 'localhost',
port: 8545,
network_id: '*' // Match any network id
}
}
}
****************************************************
Step7: run dev[need go to directory first:]
cd /Users/rongfang/myproject/project2/
$npm run dev
Step8: open url