当前位置: 首页 > 工具软件 > ES6-Shim > 使用案例 >

angular(2+)报错处理之 -- 关于polyfills.ts、'es5-shim'、'es6-shim'

唐阳飙
2023-12-01

服务器上启动项目报了polyfills.ts、'es5-shim'、'es6-shim'相关的错

[1m[31mERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'es5-shim' in '/root/.jenkins/workspace/Platform-Service-StaticResource/src'
 @ ./src/polyfills.ts 2:0-18
 @ multi ./src/polyfills.ts[39m[22m

[1m[31mERROR in ./src/polyfills.ts
Module not found: Error: Can't resolve 'es6-shim' in '/root/.jenkins/workspace/Platform-Service-StaticResource/src'
 @ ./src/polyfills.ts 3:0-18
 @ multi ./src/polyfills.ts[39m[22m
Build step 'Execute shell' marked build as failure
Finished: FAILURE
复制代码

解决办法:升级@angular/cli

npm uninstall -g @angular/cli
npm uninstall --save-dev @angular/cli
npm cache clean
npm install -g @angular/cli@latest
npm install --save -dev @angular/cli@latest
复制代码

强制清除缓存

npm cache clean --force
复制代码

或者

npm cache verify
复制代码

| 更多报错处理更新于 github

 类似资料: