我正在使用@ 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/src
tsconfig.server.json中发生了倍增。我在为Angular运行build:ssr时遇到此错误,这里描述的解决方案:npm run build:ssr在angular 8中不起作用非常简单。我们需要编辑src / tsconfig.server.json。
我必须进行两项更改;两者都在该解决方案中进行了描述。
导航 src/tsconfig.server.json
src/main.server.ts
为main.server.ts
,server.ts
为../server.ts
。确实为解决方案提供了另一个线索,
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句