aspnet-starter-kit-2.0 icon indicating copy to clipboard operation
aspnet-starter-kit-2.0 copied to clipboard

NodeInvocationException: Prerendering failed because of error: Error: Cannot find module

Open fera2k opened this issue 6 years ago • 2 comments

I've tried to run it on Windows 10 and got this issue. I'm still investigating more, but maybe someone can give me a clue. NodeInvocationException: Prerendering failed because of error: Error: Cannot find module '(...) wwwroot\dist\server\main-server'

the main-server.js file is there and seems to be ok.

Microsoft Windows [Version 10.0.17134.523] Node v11.4.0

fera2k avatar Jan 30 '19 15:01 fera2k

What command are you using to start the server ? What is your node, npm and yarn version? you have to be in the root of the project to run the command line.

Try maybe to clean everything and reinstall once again with those commands assuming you use yarn.

yarn cache clean // if using yarn
git clean -dxf
yarn install
yarn start

Hope this helps

tjaskula avatar Feb 06 '19 16:02 tjaskula

In my case this was because I used a long name for the root path. Change it to a simpler and shorter one and it should work

lebronjl avatar Apr 24 '19 14:04 lebronjl