我将我的角度CLI从1.7更新到了7〜,并且出现此错误。
ERROR in ./node_modules/edit-json-file/lib/index.js
Module not found: Error: Can't resolve 'fs' in 'D:\Projects\Dell.Studio.UI\Dell.Studio.UI.API\node_modules\edit-json-file\lib'
ERROR in ./node_modules/jsonpath/generated/parser.js
Module not found: Error: Can't resolve 'fs' in 'D:\Projects\Dell.Studio.UI\Dell.Studio.UI.API\node_modules\jsonpath\generated'
ERROR in ./node_modules/jsonpath/lib/grammar.js
Module not found: Error: Can't resolve 'fs' in 'D:\Projects\Dell.Studio.UI\Dell.Studio.UI.API\node_modules\jsonpath\lib'
ERROR in ./node_modules/r-json/lib/index.js
Module not found: Error: Can't resolve 'fs' in 'D:\Projects\Dell.Studio.UI\Dell.Studio.UI.API\node_modules\r-json\lib'
我不在代码中的任何地方使用fs,它是执行此操作的节点模块之一。我已经尝试安装 advanced-json-path ,但遇到相同的错误。我也尝试安装 fs ,但这也无济于事。怎么了?
这是我的package.json的外观
{
"name": "client-app",
"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-devkit/core": "^7.3.6",
"@angular/animations": "^7.2.9",
"@angular/cdk": "^7.3.4",
"@angular/common": "^7.2.9",
"@angular/compiler": "^7.2.9",
"@angular/core": "^7.2.9",
"@angular/flex-layout": "^7.0.0-beta.23",
"@angular/forms": "^7.2.9",
"@angular/http": "^7.2.9",
"@angular/platform-browser": "^7.2.9",
"@angular/platform-browser-dynamic": "^7.2.9",
"@angular/platform-server": "^7.2.9",
"@angular/router": "^7.2.9",
"@handsontable/angular": "^4.0.0",
"@ng-bootstrap/ng-bootstrap": "^4.1.0",
"@swimlane/dragula": "^3.7.3",
"@swimlane/ngx-datatable": "^14.0.0",
"@swimlane/ngx-dnd": "^6.0.0",
"@types/dragula": "^2.1.34",
"@types/file-saver": "^2.0.0",
"@types/html2canvas": "0.0.35",
"ang-jsoneditor": "^1.7.3",
"angular-confirmation-popover": "^4.2.0",
"angular-font-awesome": "^3.1.2",
"angular-split": "^2.0.1",
"angular2-multiselect-dropdown": "^4.2.1",
"angular2-prettyjson": "^3.0.1",
"buffer": "^5.2.1",
"core-js": "^2.6.5",
"deep-object-diff": "^1.1.0",
"easy-json-schema": "0.0.2-beta",
"edit-json-file": "^1.2.1",
"events": "^3.0.0",
"file-saver": "^2.0.1",
"flatted": "^2.0.0",
"font-awesome": "^4.7.0",
"handsontable": "^7.0.0",
"html2canvas": "^1.0.0-alpha.12",
"jquery": "^3.3.1",
"json-to-json-transformer": "^1.0.0",
"jsoneditor": "^5.31.1",
"jsonpath": "^1.0.1",
"jspdf": "^1.5.3",
"lodash": "^4.17.11",
"nested-property": "0.0.7",
"ng-block-ui": "^2.1.1",
"ng-multiselect-dropdown": "^0.2.3",
"ng-sidebar": "^8.0.0",
"ng2-bootstrap-modal": "https://github.com/Sky4CE/ng2-bootstrap-modal/tarball/v.1.0.2",
"ng2-dragula": "^2.1.1",
"ng2-eonasdan-datetimepicker": "^0.1.4",
"ng2-file-upload": "^1.3.0",
"ng2-linq": "^1.0.0",
"ngx-accordion": "0.0.17",
"ngx-bootstrap": "^3.2.0",
"ngx-clipboard": "^12.0.0",
"ngx-cookie-service": "^2.1.0",
"ngx-datetime-picker": "^2.0.0",
"ngx-filter-pipe": "^2.1.2",
"ngx-order-pipe": "^2.0.2",
"ngx-owl-carousel": "^2.0.7",
"ngx-papaparse": "^3.0.2",
"ngx-popover": "0.0.16",
"ngx-select-dropdown": "^1.0.1",
"ngx-toasta": "^0.1.0",
"ngx-tooltip": "0.0.9",
"npm": "^6.9.0",
"object-rename-keys": "^1.2.1",
"path": "^0.12.7",
"pretty-easy-date-check": "^1.2.4",
"replaceall": "^0.1.6",
"rxjs": "^6.4.0",
"rxjs-compat": "^6.4.0",
"stream": "0.0.2",
"timers": "^0.1.1",
"tslib": "^1.9.0",
"xml2js": "^0.4.19",
"zone.js": "^0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.6",
"@angular/cli": "^7.3.6",
"@angular/compiler-cli": "^7.2.9",
"@angular/language-service": "^7.2.9",
"@types/jasmine": "^3.3.9",
"@types/jasminewd2": "~2.0.6",
"@types/jquery": "^3.3.29",
"@types/node": "^11.11.3",
"advanced-json-path": "^1.0.8",
"codelyzer": "^5.0.0-beta.1",
"fs": "0.0.1-security",
"jasmine-core": "^3.3.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^4.0.1",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^2.0.0",
"karma-coverage-istanbul-reporter": "^2.0.5",
"karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"lodash-es": "^4.17.11",
"protractor": "^5.4.2",
"rxjs-tslint": "^0.1.7",
"ts-node": "~8.0.3",
"tslint": "^5.14.0",
"typescript": "3.2.2"
}
}