Я занимаюсь разработкой веб-приложения Spring Boot + Angular 6, но получаю эти ошибки при создании кода веб-интерфейса с ng build
.Кто-нибудь знает, как исправить?
Вы можете найти ошибки компиляции ниже.Похоже, ранее эту ошибку можно было исправить с помощью некоторой конфигурации в веб-пакете.
Date: 2018-08-26T12:06:52.322Z
Hash: 95b8c40c01fd2ba0a506
Time: 13116ms
chunk {main} main.js, main.js.map (main) 104 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 226 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 138 kB [rendered]
chunk {styles} styles.js, styles.js.map (styles) 147 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 5 MB [initial] [rendered]
ERROR in ./node_modules/selenium-webdriver/firefox/binary.js
Module not found: Error: Can't resolve 'child_process' in '/home/myProject/node_modules/selenium-webdriver/firefox'
ERROR in ./node_modules/selenium-webdriver/io/exec.js
Module not found: Error: Can't resolve 'child_process' in '/home/myProject/node_modules/selenium-webdriver/io'
ERROR in ./node_modules/selenium-webdriver/net/portprober.js
Module not found: Error: Can't resolve 'child_process' in '/home/myProject/node_modules/selenium-webdriver/net'
ERROR in ./node_modules/selenium-webdriver/node_modules/tmp/lib/tmp.js
Module not found: Error: Can't resolve 'crypto' in '/home/myProject/node_modules/selenium-webdriver/node_modules/tmp/lib'
ERROR in ./node_modules/fs.realpath/old.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/fs.realpath'
ERROR in ./node_modules/fs.realpath/index.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/fs.realpath'
ERROR in ./node_modules/glob/sync.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/glob'
ERROR in ./node_modules/glob/glob.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/glob'
ERROR in ./node_modules/rimraf/rimraf.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/rimraf'
ERROR in ./node_modules/selenium-webdriver/opera.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver'
ERROR in ./node_modules/selenium-webdriver/chrome.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver'
ERROR in ./node_modules/selenium-webdriver/edge.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver'
ERROR in ./node_modules/selenium-webdriver/phantomjs.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver'
ERROR in ./node_modules/selenium-webdriver/ie.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver'
ERROR in ./node_modules/selenium-webdriver/firefox/extension.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver/firefox'
ERROR in ./node_modules/selenium-webdriver/firefox/binary.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver/firefox'
ERROR in ./node_modules/selenium-webdriver/firefox/profile.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver/firefox'
ERROR in ./node_modules/selenium-webdriver/io/index.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver/io'
ERROR in ./node_modules/selenium-webdriver/lib/devmode.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver/lib'
ERROR in ./node_modules/selenium-webdriver/net/portprober.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver/net'
ERROR in ./node_modules/selenium-webdriver/node_modules/tmp/lib/tmp.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver/node_modules/tmp/lib'
ERROR in ./node_modules/selenium-webdriver/remote/index.js
Module not found: Error: Can't resolve 'fs' in '/home/myProject/node_modules/selenium-webdriver/remote'
ERROR in ./node_modules/selenium-webdriver/http/index.js
Module not found: Error: Can't resolve 'http' in '/home/myProject/node_modules/selenium-webdriver/http'
ERROR in ./node_modules/selenium-webdriver/http/index.js
Module not found: Error: Can't resolve 'https' in '/home/myProject/node_modules/selenium-webdriver/http'
ERROR in ./node_modules/selenium-webdriver/net/index.js
Module not found: Error: Can't resolve 'os' in '/home/myProject/node_modules/selenium-webdriver/net'
ERROR in ./node_modules/xml2js/lib/parser.js
Module not found: Error: Can't resolve 'timers' in '/home/myProject/node_modules/xml2js/lib'
ERROR in ./node_modules/selenium-webdriver/firefox/profile.js
Module not found: Error: Can't resolve 'vm' in '/home/myProject/node_modules/selenium-webdriver/firefox'
Это мой package.json:
{
"name": "client",
"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/common": "6.1.4",
"@angular/compiler": "6.1.4",
"@angular/core": "6.1.4",
"@angular/forms": "6.1.4",
"@angular/http": "6.1.4",
"@angular/platform-browser": "6.1.4",
"@angular/platform-browser-dynamic": "6.1.4",
"@angular/router": "6.1.4",
"bootstrap": "^4.1.3",
"core-js": "^2.5.7",
"fs": "0.0.1-security",
"grpcc": "^1.1.3",
"http": "0.0.0",
"https": "^1.0.0",
"jquery": "^3.3.1",
"net": "^1.0.2",
"path": "^0.12.7",
"popper.js": "^1.14.4",
"rxjs": "^6.0.0",
"rxjs-compat": "^6.0.0-rc.0",
"stream": "0.0.2",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.7.0",
"@angular/cli": "6.0.0",
"@angular/compiler-cli": "6.1.4",
"@angular/language-service": "6.1.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~10.5.6",
"codelyzer": "~4.4.2",
"jasmine-core": "^3.2.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^2.0.5",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^1.2.0",
"protractor": "^5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "^2.7.2"
},
"browser": {
"fs": false,
"path": false,
"os": false,
"child_process": false
}
}
Это мой tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
],
"module": "es2015",
"baseUrl": "./"
}
}