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?

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 truffle@3.2.2

  • 1
    I tried both of 1&2, it still has the Error cannot find module 'truffle-export', but thanks anyway – jiaxyan Jul 6 '17 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). – Travis Jacobs Jul 6 '17 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 Jul 6 '17 at 6:27
  • thanks you guys, after running 'npm un -g truffle' to uninstall & 'npm i -g truffle@3.2.2' 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 Jul 7 '17 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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