![](/img/trans.png)
[英]Use of getAttributeNodeNS() is deprecated. Use getAttributeNS() instead
[英]In angular 5.2.1 production getting …ules\bootstrap\dist\css\bootstrap.cssNode#moveTo was deprecated. Use Container#append
參見下面的版本信息和package.json
版:
ng-version="5.2.1"
package.json
{
"name": "experiment",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.1.1",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.1.1",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"jquery": "^1.12.4",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.5.5",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
}
}
命令:
1) ng build
:在這里我沒有收到任何警告
2) ng build --prod
:在這里我得到:
10%建築模塊4/6模塊2活動中
...不建議使用ules \\ bootstrap \\ dist \\ css \\ bootstrap.cssNode#moveTo。
使用Container#append。 日期:2018-01-23T06:19:48.732Z哈希:
34c92447878ca7d7b148時間:150966ms塊{0}
polyfills.39c2675f132c0f995f11.bundle.js(polyfills)59.5 kB [初始]
[呈現]塊{1} main.5222b9447b8051d66fa2.bundle.js(主要)728 kB
[初始] [渲染]塊{2} styles.b635c6f169c366ff5b2f.bundle.css
(樣式)217 kB [初始] [渲染]塊{3}
inline.676417dc826d752b57e1.bundle.js(inline)1.45 kB [entry]
[呈現]
我用谷歌搜索, https://github.com/angular/angular-cli/issues/8598得到了,但是,我沒有解決方案。
npm install -g npm-check-updates
該命令是為了查看軟件包的區別,而不是要解決任何問題。建議您刪除node_modules文件夾並執行此命令
ncu -u
和
npm install --save
更新您的package.json。 完成后,嘗試
ng build --prod
請將“ @ angular / cli”更新為“ 1.7.3”
步驟1:npm刪除@ angular / cli步驟2:npm緩存清理--force步驟3:npm安裝-g @ angular / cli @ 1.7.3
仍然卡住,然后使用更新您的package.json
“ @ angular / cli”:“ 1.7.3”並運行npm install
經過測試並為我工作
我通過做RND來解決。 最后,通過在我的項目中刪除不推薦使用的CSS來獲得解決方案。
例如.section{color:#ddd;} .section{font-size:14px}
這是不推薦使用的CSS,我改為.section{color:#ddd; font-size:14px}
.section{color:#ddd; font-size:14px}
並且我自定義了引導CSS,例如,我將對我的項目有用的CSS復制到了style.css中。
對我有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.