我正在尝试更新项目节点版本,因为我需要更新一些依赖于较新版本的打字稿的软件包。
我更新了npm,然后运行了 npm cache clean -f 。然后在尝试运行时:
npm i -g n
我收到以下错误:
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@6.0.1: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Rob\AppData\Roaming\npm-cache\_logs\2019-09-18T08_58_12_545Z-debug.log
这是我的package.json:
{
...
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.10",
"@angular/cdk": "^6.4.7",
"@angular/cli": "^8.3.4",
"@angular/common": "^6.1.8",
"@angular/compiler": "^6.1.8",
"@angular/compiler-cli": "^8.2.6",
"@angular/core": "^6.1.8",
"@angular/forms": "^6.1.8",
"@angular/http": "^6.1.8",
"@angular/material": "^6.4.7",
"@angular/platform-browser": "^6.1.8",
"@angular/platform-browser-dynamic": "^6.1.8",
"@angular/platform-server": "^6.1.8",
"@angular/router": "^6.1.8",
"@fortawesome/fontawesome-free": "^5.10.2",
"@material-extended/mde": "^2.3.1",
"@ng-bootstrap/ng-bootstrap": "^1.1.2",
"@swimlane/ngx-charts": "^6.1.0",
"@swimlane/ngx-datatable": "^16.0.2",
"@types/chart.js": "^2.8.5",
"@types/file-saver": "^1.3.1",
"amazing-time-picker": "^1.8.0",
"angular-popper": "^1.0.0",
"angular2-material-datepicker": "^0.5.0",
"angular2-moment": "^1.9.0",
"angular2-wizard": "^0.4.0",
"angular4-datepicker": "^1.0.1",
"angular5-csv": "0.2.11",
"animate.css": "^3.7.2",
"bootstrap": "^3.4.1",
"chart.js": "^2.8.0",
"core-js": "^2.6.9",
"d3": "^4.13.0",
"file-saver": "^1.3.8",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"html2canvas": "^1.0.0-rc.3",
"jquery": "^3.4.1",
"jspdf": "^1.5.3",
"jspdf-autotable": "^3.1.1",
"localforage": "^1.7.3",
"lodash": "^4.17.11",
"ng-connection-service": "^1.0.4",
"ng-multiselect-dropdown": "^0.2.3",
"ng2-archwizard": "^2.1.0",
"ng2-bootstrap-modal": "^1.0.1",
"ng2-charts": "^1.6.0",
"ng2-date-picker": "^2.11.0",
"ng2-daterangepicker": "^2.0.12",
"ng2-order-pipe": "^0.1.4",
"ng2-slim-loading-bar": "^4.0.0",
"ng2-uploader": "^2.0.0",
"ng4-geoautocomplete": "^0.1.0",
"ngforage": "^3.0.1",
"ngx-bootstrap": "^2.0.5",
"ngx-chips": "1.9.8",
"ngx-color-picker": "^4.5.3",
"ngx-editor": "^4.1.0",
"ngx-order-pipe": "^2.0.4",
"ngx-stepper": "^1.1.6",
"ngx-toastr": "^10.2.0",
"npm": "^5.10.0",
"popper.js": "^1.15.0",
"rxjs": "6.3.3",
"rxjs-compat": "6.3.3",
"typescript": "^3.6.3",
"xlsx": "^0.13.5",
"zone.js": "^0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.6.3",
"@types/google.analytics": "0.0.39",
"@types/jasmine": "2.8.4",
"@types/node": "^10.14.18",
"angular2-tag-input": "^1.2.3",
"clean-webpack-plugin": "^0.1.19",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"replace-in-file": "^3.4.4",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"webpack": "^4.40.2"
}
}
更新的原因是因为将 typescript 更新为@ 3.6.3
后,未定义 getColorDepth()函数。