I use the PrerenderSpaPlugin plug-in for precompilation in my vue project, and I always report the following error:
| building for production...E:\web\sell\node_modules\prerender-spa-plugin\lib\compile-to-html.js:82
if (error) throw error
^
Error: Command failed: E:\web\sell\node_modules\phantomjs-prebuilt\lib\phantom\bin\phantomjs.exe E:\web\sell\node_modules\prerender-spa-plugin\lib\phantom-page-render.js http://localhost:8000/ {}
at ChildProcess.exithandler (child_process.js:204:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:891:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sell@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sell@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\29488\AppData\Roaming\npm-cache\_logs\2018-03-06T07_21_11_126Z-debug.log
this is the configuration of the PrerenderSpaPlugin plug-in in my webpack.prod.conf.js
new PrerenderSpaPlugin(
// Absolute path to compiled SPA
path.join(__dirname,"../dist"),
// List of routes to prerender
[ "/", "/order", "/main" ]
)
spent the whole afternoon without solving it, asking for the boss"s answer