Search code examples
ethereumsoliditytruffle

truffle serve throws the below mentioned error?


:\blockchain\truffle\demo\mortgage-blockchain-demo>truffle serve
erving static assets in .\build on port 8080...
ebuilding...
:\Users\Mabel\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:220
48
 return (new fsevents(path)).on('fsevent', callback).start();
         ^

ypeError: fsevents is not a constructor
   at createFSEventsInstance (C:\Users\Mabel\AppData\Roaming\npm\node_modules\t
uffle\build\cli.bundled.js:220548:11)
   at setFSEventsListener (C:\Users\Mabel\AppData\Roaming\npm\node_modules\truf
le\build\cli.bundled.js:220602:16)
   at FSWatcher.FsEventsHandler._watchWithFsEvents (C:\Users\Mabel\AppData\Roam
ng\npm\node_modules\truffle\build\cli.bundled.js:220766:16)
   at FSWatcher.<anonymous> (C:\Users\Mabel\AppData\Roaming\npm\node_modules\tr
ffle\build\cli.bundled.js:220900:25)
   at LOOP (fs.js:1758:14)
   at _combinedTickCallback (internal/process/next_tick.js:67:7)
   at process._tickCallback (internal/process/next_tick.js:98:9)

kindly help me in resolving the issue . I am running on a windows 7 machine .

trying to do ethereum truffle setup.


Solution

  • Disable the FsEvents when not used:

    • C:\Users\UserName\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js

      // if (!FsEventsHandler.canUse())

      opts.useFsEvents = false;

    Steps:

    • truffle compile && truffle build && truffle migrate && truffle serve