2

Thanks to Kshitij's answer at another page! but I still have this error after applying this answer. which drives me crazy! Sorry for post the question as a answer-_-

After run truffle init and truffle compile, it works fine. the contracts that I compile are examples from truffle:(when I change to HelloWorld it's the exactly same error)

  • ConvertLib.sol MetaCoin.sol Migrations.sol

other information is:

  • ubuntu 14.04.2
  • node -v v7.10.0
  • npm -c 4.2.0
  • Truffle v3.3.2 (core: 3.3.1)
  • Solidity v0.4.11 (solc-js)

Every time I run "truffle migrate" it shows Error, with or without testrpc running

error message:

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> 
    ...

installing truffle-expect won't work, would anyone give me a hand please?

2

1 Answer 1

1

This is a known issue and I'm sure truffle will have a fix for it very soon.

Workaround 1

For now, try running npm install -g truffle-expect truffle-config web3, which seems to work for several people.

Workaround 2

If that doesn't work for you, try installing an earlier version of truffle until the fix is applied.

e.g.

npm i -g [email protected]

4
  • 1
    I tried both of 1&2, it still has the Error cannot find module 'truffle-export', but thanks anyway
    – jiaxyan
    Commented Jul 6, 2017 at 3:37
  • hmm, you're probably using truffle globally, so it was my mistake in number 2. Try running npm un -g truffle to uninstall, then my updated command above to install earlier version again (includes -g flag). Commented Jul 6, 2017 at 3:42
  • I'm sure I had to close and open the console window after installing, thought I'd mention it in case that was your issue
    – stradled
    Commented Jul 6, 2017 at 6:27
  • thanks you guys, after running 'npm un -g truffle' to uninstall & 'npm i -g [email protected]' to reinstall 3.2.2 version. I found my truffle version is still 3.3.2. (And I close and open the console window after installing)
    – jiaxyan
    Commented Jul 7, 2017 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.