使用@ nguniversal / express-engine程序包的有角度的SSR会收到此错误(错误TS6053中的错误:未找到文件'/project/src/server.ngtypecheck.ts'。)

MF340

我正在使用@ nguniversal / express-engine以角度的方式进行服务器端渲染。当我运行$ nmp build:ssr或出现$ npm run dev:ssr此错误时。

ERROR in error TS6053: File 'C:/dev/web/workspace/project/src/server.ngtypecheck.ts' not found.
error TS6053: File 'C:/dev/web/workspace/project/src/server.ts' not found.
error TS6053: File 'C:/dev/web/workspace/project/src/src/main.server.ngtypecheck.ts' not found.
error TS6053: File 'C:/dev/web/workspace/project/src/src/main.server.ts' not found.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:ssr: `ng build --prod && ng run client:server:production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:ssr script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 
詹姆斯·马丁

遇到相同的问题,src/srctsconfig.server.json中发生了倍增。我在为Angular运行build:ssr时遇到此错误,这里描述的解决方案:npm run build:ssr在angular 8中不起作用非常简单。我们需要编辑src / tsconfig.server.json。

我必须进行两项更改;两者都在该解决方案中进行了描述。

导航 src/tsconfig.server.json

  • 更改src/main.server.tsmain.server.ts
  • 更改server.ts../server.ts

确实为解决方案提供了另一个线索,

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档