I also face the same problem and now i solved that problem there is nothing wrong in your code .you have to just run npm install in folder directory where your index.js is present and then run npm run dev