-2

I want to run "truffle serve" which linked to localhost:8080. But get this error message

Then I tried to find the problem which may be the version of truffle. I tried "npm run dev". But failed with this message.

How can I solve the problem?, please help me.

XPD
  • 1,121
  • 1
  • 13
  • 26
jianwei
  • 3
  • 5
  • 2
    `dev` in this scenario is the name of a property in the `scripts` object of your `package.json`. Obviously this property has not been defined. – connexo Dec 31 '17 at 10:23
  • I must add dev scripts in my dapp/package.json ? – jianwei Dec 31 '17 at 10:39
  • Please [edit] your post to include actual code and the actual error message instead of images -- http://idownvotedbecau.se/imageofcode http://idownvotedbecau.se/imageofanexception/ – tripleee Jun 20 '18 at 04:09

2 Answers2

1

Add this to the scriptssection in your package.json:

"scripts": {
   "dev": "truffle serve",
   // other scripts that may already be defined here
}

This allows you to execute truffle serve by issueing npm run dev.

Regarding your fsevents is not a constructor problem, please refer to

https://github.com/trufflesuite/truffle/issues/463

which suggests that issueing

truffle init webpack

solves the problem.

connexo
  • 53,704
  • 14
  • 91
  • 128
0

Try to use the command npm run serve

tripleee
  • 175,061
  • 34
  • 275
  • 318
francais
  • 19
  • 4