cli
cli copied to clipboard
[BUG] npm install does nothing when output is redirected to file and loglevel is verbose
Is there an existing issue for this?
- [X] I have searched the existing issues
This issue exists in the latest npm version
- [X] I am using the latest npm
Current Behavior
npm install esbuild --loglevel verbose 2>&1 | echo > test.log in empty folder does nothing, no output in file, no package.json appeared, test.log file is empty
At the same time command npm install esbuild --loglevel verbose works as expected - prints output and files package.json, lock and node_modules appear.
Seems like a bug?
Expected Behavior
Expected that where output is sent does not influence what command is doing. Install should work and output appear in the file.
Steps To Reproduce
- In empty folder
- Run
npm install esbuild --loglevel verbose 2>&1 | echo > test.log - Empty test.log appears and nothing else happens
Environment
- npm: 8.5.0
- Node.js: v14.19.0
- OS Name: Ubuntu 20.04
- System Model Name: Lenovo T480s
- npm config: -
; "user" config from /home/tim/.npmrc
prefix = "/home/tim/.npm-global"
; node bin location = /snap/node/5856/bin/node
; cwd = /home/tim/empty
; HOME = /home/tim