verekia / js-stack-from-scratch

🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack.
MIT License
20.09k stars 1.99k forks source link

In chapter 06 the pm logs 'Cannot find module' error #191

Closed xaviertung closed 7 years ago

xaviertung commented 7 years ago

Type of issue: bug?

Chapter:06

When running the command yarn prod:start the PM logs error are as follows:

/Users/xaviertung/.pm2/logs/server-error-0.log last 15 lines:
0|server   |     at Object.Module._extensions..js (module.js:580:10)
0|server   |     at Module.load (module.js:488:32)
0|server   |     at tryModuleLoad (module.js:447:12)
0|server   |     at Function.Module._load (module.js:439:3)
0|server   | Error: Cannot find module './component/nav.jsx'
0|server   |     at Function.Module._resolveFilename (module.js:470:15)
0|server   |     at Function.Module._load (module.js:418:25)
0|server   |     at Module.require (module.js:498:17)
0|server   |     at require (internal/module.js:20:19)
0|server   |     at Object.<anonymous> (/Users/xaviertung/WebstormProjects/js-stack-from-scratch-demo/lib/shared/app.js:15:12)
0|server   |     at Module._compile (module.js:571:32)
0|server   |     at Object.Module._extensions..js (module.js:580:10)
0|server   |     at Module.load (module.js:488:32)
0|server   |     at tryModuleLoad (module.js:447:12)
0|server   |     at Function.Module._load (module.js:439:3)

But the server started properly, what happend? Thx!

xaviertung commented 7 years ago

I'm sorry for my own mistake, it's the reson that the problem is caused by historical error, and the error will be displayed every running time.