1
我現在正在關注穩定性教程,並且當我運行松露遷移時我正遇到錯誤。此外,testrpc正在另一個終端選項卡中運行,所以此問題與此處的其他人無關。松露遷移錯誤(測試rpc正在運行)
我運行truffle init,然後將我的HelloWorld.sol智能合約添加到合同文件夾。
pragma solidity ^0.4.11;
contract HelloWorld {
uint public balance;
function HelloWorld(){
balance = 1000;
}
}
我然後運行松露編譯,一切工作正常
Compiling ./contracts/ConvertLib.sol...
Compiling ./contracts/HelloWorld.sol...
Compiling ./contracts/MetaCoin.sol...
Compiling ./contracts/Migrations.sol...
Writing artifacts to ./build/contracts
我加入下面我2_deploy_contracts.js遷移文件
var HelloWorld = artifacts.require("./HelloWorld.sol");
module.exports = function(deployer) {
deployer.deploy(HelloWorld);
};
然而,當我運行松露遷移我收到出現以下錯誤:
Error: Cannot find module 'truffle-expect'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:85773:14)
at __webpack_require__ (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:21:30)
at Object.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:59914:15)
at __webpack_require__ (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:21:30)
at Object.<anonymous> (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:201851:15)
at __webpack_require__ (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:21:30)
我試過npm安裝松露期待,但似乎不工作...任何想法?
非常有幫助,謝謝! – whosbuddy