Ich verwende npm run script, um Aufgaben wie "Build" und "Test" zu tun.Kann ich "npm ERR!" Ausgabe bei Verwendung von npm run Skript?
Zum Beispiel meine package.json
sieht wie folgt aus:
{
"name": "fulfillment-service",
"version": "1.0.0",
"description": "Endpoint for CRUD operations on fulfillment status",
"main": "src/server.js",
"scripts": {
"build": "tsc",
"test": "tape tests/*.js"
},
"dependencies": {},
"devDependencies": {
"typescript": "^1.8.10"
}
}
Als ich npm run build
laufen und es erfolgreich ist, der Ausgang ist die folgende:
> [email protected] build d:\code\fulfillment-service
> tsc
Als ich npm run build
laufen und es schlägt fehl , die Ausgabe ist die folgende:
> [email protected] build d:\code\fulfillment-service
> tsc
src/server.ts(51,81): error TS2339: Property 'connection' does not exist on type 'IncomingMessage'.
npm ERR! Windows_NT 10.0.10586
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.2.1
npm ERR! npm v3.9.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script 'tsc'.
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 fulfillment-service package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs fulfillment-service
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls fulfillment-service
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! d:\code\fulfillment-service\npm-debug.log
Dies füllt die gesamte Konsole mit nutzlosen Informationen, und ich muss nach oben scrollen, um zu sehen, warum es fehlgeschlagen ist.
Gibt es auf jeden Fall die Zeilen, die während der Entwicklung mit npm ERR!
beginnen, zu verbergen?
'npm run build --silent' – gcampbell
Es gibt ein Problem bezüglich der Ausgabe von Run-Skripten. Siehe [npm/8821] (https://github.com/npm/npm/issues/8821) – styfle