angular8踩坑記

1>SSL certificate problem: unable to get local issuer certificate

1.1 git config --global http.sslVerify false

2>An unhandled exception occurred: Job name "..getProjectMetadata" does not exist.

2.1 npm install -g @angular/cli@8.3.4

2.2 npm i @angular-devkit/build-angular@0.803.24

3> Could not find plugin "proposal-numeric-separator".

3.1 npm install @babel/plugin-proposal-numeric-separator (安裝)

3.2 node_modules/@babel/preset-env/lib/available-plugins.js文件 (修改)

3.2.1 var _pluginProposalNumericSeparator = _interopRequireDefault(require("@babel/plugin-proposal-numeric-separator"));

3.2.2 var _default = {

? ? ? ? ? "proposal-numeric-separator": _pluginProposalNumericSeparator.default,

? ? ? }

4> Could not find plugin "proposal-class-properties".

4.1 npm install --save-dev @babel/plugin-proposal-class-properties

"start": "ng serve --proxy-config proxy.conf.json --port 4201",

"build": "ng build --base-href /login/",

5>Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i @types/node`

and then add `node` to the types field in your tsconfig.

解決: 在tsconfig.app.json文件下 compilerOptions => "types": ["node"]

6>An unhandled exception occurred: Job name "..getProjectMetadata" does not exist.

npm i @angular-devkit/build-angular@0.803.24

7> 創(chuàng)建component 報(bào)錯(cuò)說有多個(gè)module或者在多個(gè)module出現(xiàn)

ng generate component hello --module=people-manage.module(文件名)

--module= 指定module可以解決

8>解決不生成spec.ts文件

只需加上 --no-spec即可

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容