节点反应站点地图错误:internal / modules / cjs / loader.js

时间:2019-02-25 06:06:38

标签: node.js

由于此错误,我无法生成站点地图。

Error: Cannot find module 'components/Root'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/mel/apps/flyspaces-react-js/server/modules/ssr.js:8:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at loader (/home/mel/apps/flyspaces-react-js/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/mel/apps/flyspaces-react-js/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/mel/apps/flyspaces-react-js/server/routes/ssr.js:5:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at loader (/home/mel/apps/flyspaces-react-js/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/mel/apps/flyspaces-react-js/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)

如何解析自定义模块路径? modules/ssr.js是SSR的自定义模块。我正在使用react-router-sitemap。

0 个答案:

没有答案