刚拿到一个项目要做二次开发,是一个angular项目,我拿到后yarn install 装上所有插件,然后ng serve,报了很多错误,蒙圈了。
先报了很多行lodash的错误。我这里就放了3行,差不多有好几十行错误。
ERROR in /Users/www/quanke3.0/node_modules/@types/lodash/common/object.d.ts (1405,67): ';' expected.
ERROR in /Users/www/quanke3.0/node_modules/@types/lodash/common/object.d.ts (883,45): Cannot find name 'ObjectIterator'.
ERROR in /Users/www/quanke3.0/node_modules/@types/lodash/common/object.d.ts (893,31): Cannot find name 'ObjectIterator'.
第二块错误。
/Users/www/quanke3.0/src/app/patients/medical-records-details/diagnosis-orders/doctor-orders/order-laboratory/order-laboratory.component.ts (102,15): Property 'pick' does not exist on type 'LoDashStatic'.
ERROR in /Users/www/quanke3.0/src/app/patients/medical-records-details/diagnosis-orders/doctor-orders/order-imaging/order-imaging.component.ts (99,15): Property 'pick' does not exist on type 'LoDashStatic'.
ERROR in /Users/www/quanke3.0/src/app/patients/medical-records-details/diagnosis-orders/doctor-orders/order-skin-test/order-skin-test.component.ts (132,13): Property 'pick' does not exist on type 'LoDashStatic'.
第三块错误
ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader?{"ident":"postcss"}!./node_modules/@angular/cli/node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss
Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (108)
For more information on which environments are supported please see:.......
9月8日下午4点
yarn remove lodash @types/lodash
yarn add lodash
按照这步,lodash 的错误没了,不过有以下错误,有什么影响
warning " > @ngx-loading-bar/core@2.2.0" has incorrect peer dependency "@angular/common@>=5.0.0".
warning " > @ngx-loading-bar/core@2.2.0" has incorrect peer dependency "rxjs@^5.6.0-forward-compat.0 || ^6.0.0-beta.0".
warning " > ng-zorro-antd@0.5.5" has unmet peer dependency "@angular/cdk@2.0.0-beta.8".
warning "@angular/cli > @ngtools/webpack@1.6.2" has unmet peer dependency "enhanced-resolve@^3.1.0".
然后yarn add sass 它提示node版本大于4并小于9
The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "18.16.0"
我node切换 v8.17.0,又提示我
sass@1.78.0: The engine "node" is incompatible with this module. Expected version ">=14.0.0". Got "8.17.0"
这该怎么弄?
请问这些错误应该怎么解决?