Truffle compile Cant find module error

0 votes

First i did

truffle unbox webpack

and then tried to compile 

truffle compile

But I get this error:

Error: Cannot find module 'babel-register'

    at Function.Module._resolveFilename (module.js:547:15)

    at Function.Module._load (module.js:474:25)

    at Module.require (module.js:596:17)

    at require (internal/module.js:11:18)

    at Object.<anonymous> (/home/edureka/truffle/truffle.js:2:1)

    at Module._compile (module.js:652:30)

    at Object.Module._extensions..js (module.js:663:10)

    at Module.load (module.js:565:32)

    at tryModuleLoad (module.js:505:12)

    at Function.Module._load (module.js:497:3)
Dec 1, 2018 in Blockchain by digger
• 26,720 points

2 answers to this question.

0 votes

Seems like the box didn't unbox properly. Delete the file and unbox again:

rm -rf *
truffle unbox webpack
answered Dec 1, 2018 by Omkar
• 69,170 points
0 votes

You can install babel-register and try again. To install babel-register, run this command:

npm install babel-register --save-dev
answered Feb 19, 2019 by Loki

Related Questions In Blockchain

0 votes
1 answer

truffle migrate Error: “Cannot find module 'truffle-expect'”

Seems like you are missing some modules ...READ MORE

answered Jan 24, 2019 in Blockchain by Omkar
• 69,170 points
+1 vote
4 answers
0 votes
4 answers

Hyperledger fabric: enrollAdmin.js Error: Cannot find module 'fabric-client'

Change your directory to fabric-samples/fabrcar. And run: npm ...READ MORE

answered Nov 21, 2018 in Blockchain by Omkar
• 69,170 points
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,830 points
0 votes
1 answer
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,440 points
0 votes
1 answer

Truffle init: Error: Cannot find module 'original-require'

I think you need to run this ...READ MORE

answered Oct 24, 2018 in Blockchain by Omkar
• 69,170 points
–1 vote
2 answers

Truffle migrate shows Error: Cannot find module 'truffle-expect'

You can also install the basic truffle-expect ...READ MORE

answered Feb 19, 2019 in Blockchain by Rohit