2017-07-30 3 views
0

Ich habe eine einfache App mit Spring Boot und Angular 4 erstellt. Ich habe versucht, ein Skript auszuführen, das jede (npm run build) Datei von der Frontend-Datei in die src/main/resources/static-Datei packt. Aber ich bin immer einen Fehler, der ist:Fehler beim Ausführen von npm run build

npm ERR! Windows_NT 10.0.15063 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" 
npm ERR! node v6.9.4 
npm ERR! npm v3.10.10 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] postbuild: `npm run deploy` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] postbuild script 'npm run deploy'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the tasks package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  npm run deploy 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs tasks 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls tasks 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\Michał\IdeaProjects\spring-angular2-tasks-master\Spring with Angular 4\src\main\frontend\npm-debug.log 

Meine package.json Datei sieht:

{ 
    "name": "tasks", 
    "version": "0.0.0", 
    "license": "MIT", 
    "angular-cli": {}, 
    "scripts": { 
    "ng": "ng", 
    "start": "ng serve --proxy-config proxy-conf.json", 
    "build": "ng build -prod", 
    "postbuild": "npm run deploy", 
    "predeploy": "rimraf ../resources/static/ && mkdirp ../resources/static", 
    "deploy": "copyfiles -f dist/** ../resources/static", 
    "test": "ng test", 
    "pree2e": "webdriver-manager update --standalone false --gecko false", 
    "e2e": "protractor" 
    }, 
    "private": true, 
    "dependencies": { 
    "@angular/common": "^4.1.3", 
    "@angular/compiler": "^4.1.3", 
    "@angular/core": "^4.1.3", 
    "@angular/forms": "^4.1.3", 
    "@angular/http": "^4.1.3", 
    "@angular/platform-browser": "^4.1.3", 
    "@angular/platform-browser-dynamic": "^4.1.3", 
    "@angular/router": "^4.1.3", 
    "bootstrap": "^3.3.7", 
    "copyfiles": "^1.2.0", 
    "core-js": "^2.4.1", 
    "mkdirp": "^0.5.1", 
    "moment": "^2.18.1", 
    "rimraf": "^2.6.1", 
    "rxjs": "^5.0.1", 
    "ts-helpers": "^1.1.1", 
    "zone.js": "^0.8.11" 
    }, 
    "devDependencies": { 
    "@angular/cli": "^1.0.0", 
    "@angular/compiler-cli": "^4.1.3", 
    "@types/jasmine": "2.5.47", 
    "@types/node": "^7.0.22", 
    "codelyzer": "~3.0.1", 
    "jasmine-core": "2.6.2", 
    "jasmine-spec-reporter": "4.1.0", 
    "karma": "1.7.0", 
    "karma-chrome-launcher": "^2.0.0", 
    "karma-cli": "^1.0.1", 
    "karma-jasmine": "^1.0.2", 
    "karma-remap-istanbul": "^0.6.0", 
    "protractor": "~5.1.2", 
    "ts-node": "3.0.4", 
    "tslint": "^5.3.2", 
    "typescript": "~2.3.3" 
    }, 
    "description": "This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.2.6.", 
    "main": "karma.conf.js", 
    "author": "" 
} 

Was mache ich falsch?

UPDATE: Nach npm run deploy läuft ich habe:

> [email protected] predeploy C:\Users\Michał\IdeaProjects\spring-angular2-tasks-master\Spring with Angular 4\src\main\frontend 
> rimraf ../resources/static/ && mkdirp ../resources/static 


> [email protected] deploy C:\Users\Michał\IdeaProjects\spring-angular2-tasks-master\Spring with Angular 4\src\main\frontend 
> copyfiles -f dist/** ../resources/static 

'copyfiles' is not recognized as an internal or external command, 
operable program or batch file. 

npm ERR! Windows_NT 10.0.15063 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "deploy" 
npm ERR! node v6.9.4 
npm ERR! npm v3.10.10 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] deploy: `copyfiles -f dist/** ../resources/static` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] deploy script 'copyfiles -f dist/** ../resources/static'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the tasks package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  copyfiles -f dist/** ../resources/static 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs tasks 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls tasks 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\Michał\IdeaProjects\spring-angular2-tasks-master\Spring with Angular 4\src\main\frontend\npm-debug.log 
+0

Es ist zu sagen es auf dem 'npm Lauf deploy' Anruf ist versagt. Sie sollten das selbst ausführen und sehen, wie _that_ Fehler aussieht. – Matt

+0

@Matt Ich habe es ausgeführt. Bitte beachten Sie das Update. Es gibt ein Protokoll. – bielas

+0

@bielas Sie sollten wahrscheinlich Angular CLI dafür verwenden. Es ist effektiv und gibt mehr "lesbare" Fehler. – Smit

Antwort

0

Lösen Sie es von npm install copyfiles -g

Verwandte Themen