-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
GulajavaMinistudio/cli
#83Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 10.x
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
npm run is creating if it does not exist and writing if it exists into the .npm/_logs directory.
Expected Behavior
Even if logs are turned off completely with the --logs-max=0 option, the directory is still created. This calls for workarounds if the current directory is not writable (a relatively common scenario if you're working inside a container) or workarounds, but there is apparently no way to turn it off completely.
Steps To Reproduce
This Dockerfile:
FROM node:21-alpine
RUN mkdir -p /app/test && chown -R node:node /app && npm install -g npm@latest
USER node
WORKDIR /app
COPY package.json ./
WORKDIR /app/test
ENTRYPOINT ["npm", "--logs-max=0", "run", "test"]With this package.json
{
"name": "dotnpm-created",
"version": "1.0.0",
"description": "Test file",
"main": "index.js",
"scripts": {
"test": "echo \"test\""
},
"author": "",
"license": "ISC"
}When run with:
podman run --rm -it -v `pwd`:/app/test -u 1001 jjmerelo/dotnpm-testIt creates a .npm file with:
.npm:
total 12
drwxr-xr-x 3 101000 jmerelo 4096 nov 28 14:38 .
drwxrwxr-x 3 jmerelo jmerelo 4096 nov 28 14:38 ..
drwxr-xr-x 2 101000 jmerelo 4096 nov 28 14:38 _logs
.npm/_logs:
total 8
drwxr-xr-x 2 101000 jmerelo 4096 nov 28 14:38 .
drwxr-xr-x 3 101000 jmerelo 4096 nov 28 14:38 ..
So it still has an empty log directory.
Environment
npm@10.2.4node@v21.2.0- Alpine OS
- npm config:
; node bin location = /usr/local/bin/node
; node version = v21.2.0
; npm local prefix = /app
; npm version = 10.2.4
; cwd = /app/test
; HOME = /home/node
edmorley
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 10.x