我在我的项目中使用ag网格,使用ng-serve在本地运行它可以很好地完成预期的工作。但当上传到服务器时,编译allways失败,基本上出现以下错误:
ERROR in src\app\app.module.ts(87,5): Error during template compile of 'AppModule'
Could not resolve ag-grid-angular relative to c:/workspace/.../Angular/src/app/app.module.ts..
src/app.../status-cellrenderer.component.ts(2,37): error TS2307: Cannot find module 'ag-grid-angular'.
src/app/app.module.ts(36,30): error TS2307: Cannot find module 'ag-grid-angular'.
我使用AG网格版本20.0.0,并使用本教程:
https://medium.com/ag-grid/get-started-with-angular-grid-in-5-minutes-83bbb14fac93
编辑:
这是服务器上的配置:
cd Angular
cmd /c call npm install
@ECHO ############ Node.js Packages installed ###################
REM cmd /c call node_modules/.bin/ng --version
@ECHO ############ Build Angular-Site ##################
cmd /c call node_modules/.bin/ng build --prod --output-path=..\PublishOutput
nodes eu modules目录不是自己上传的。