I use npm run script to perform tasks such as build and test.
For example, my package.json looks like this:
{ "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" } }
When I launched npm run build and it will succeed, the output will be as follows:
> fulfillment-service@1.0.0 build d:\code\fulfillment-service > tsc
When I run npm run build and it fails, the output is as follows:
> fulfillment-service@1.0.0 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! fulfillment-service@1.0.0 build: `tsc` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the fulfillment-service@1.0.0 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
This fills the entire console with useless information, and I need to scroll up to see why it failed.
Do I need to hide / freeze lines starting with npm ERR! during development?
npm
styfle
source share