I'd like to capture the output of npm run start
in a file (I'm getting a ton of errors and I'd like to have more control over how I sift through the output).
When I try
npm run start > log.txt
I get a very abbreviated file (8 lines) that ends with [34mℹ[39m [90m「wdm」[39m: Failed to compile.
When I try
npm run start &> log.txt // redirect stderr and stdout to a file
I get a similarly abbreviated file (11 lines) that ends with similarly garbled output.
What am I missing?
This will work
npm run start 2>&1| tee npm.txt
Explanation:
2>&1
will redirect error stderr
to stdout
and tee command will write terminal output to file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With