antfu-collective / ni

💡 Use the right package manager
MIT License
6.25k stars 208 forks source link

ni and nci fail with version 0.22.2 #224

Closed gaetan-shopopop closed 1 month ago

gaetan-shopopop commented 1 month ago

Describe the bug

When running nci or ni with version 0.22.2 installed globally on any project (yarn or npm based), the command does nothing and exit quickly without output. This failed in our github actions with a message Process completed with exit code 1 but without more informations.

When reverting to 0.22.1 with npm install -g @antfu/ni@0.22.1, there is no issue.

Is there a verbose mode or something llike that to get more informations from these commands ?

Reproduction

Any project with a valid package.json seems enough to reproduce

System Info

System:
    OS: Linux 6.5 Linux Mint 21.3 (Virginia)
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz
    Memory: 5.41 GB / 15.35 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm

Used Package Manager

npm

Validations

Contributions

mancuoj commented 1 month ago

same here

real34 commented 1 month ago

I confirm the issue, and the workaround (pinning the version).

Reproduction

Here are a simple package.json + Dockerfile for reproduction if it can help:

{
  "name": "repro",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "echo \"Hello\""
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "axios": "^1.7.4"
  }
}
FROM node:20.16-alpine

WORKDIR /project

COPY . /project
RUN npm install -g @antfu/ni
# RUN npm install -g @antfu/ni@0.22.1

RUN nci --frozen

ENTRYPOINT ["nr"]
CMD [ "start" ]

Error output

✦ ❯ docker build .
[+] Building 3.0s (9/9) FINISHED                                                                                                                                                                                 docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                       0.0s
 => => transferring dockerfile: 217B                                                                                                                                                                                       0.0s
 => [internal] load metadata for docker.io/library/node:20.16-alpine                                                                                                                                                       0.8s
 => [internal] load .dockerignore                                                                                                                                                                                          0.0s
 => => transferring context: 53B                                                                                                                                                                                           0.0s
 => [1/5] FROM docker.io/library/node:20.16-alpine@sha256:eb8101caae9ac02229bd64c024919fe3d4504ff7f329da79ca60a04db08cef52                                                                                                 0.0s
 => => resolve docker.io/library/node:20.16-alpine@sha256:eb8101caae9ac02229bd64c024919fe3d4504ff7f329da79ca60a04db08cef52                                                                                                 0.0s
 => [internal] load build context                                                                                                                                                                                          0.0s
 => => transferring context: 322B                                                                                                                                                                                          0.0s
 => CACHED [2/5] WORKDIR /project                                                                                                                                                                                          0.0s
 => [3/5] COPY . /project                                                                                                                                                                                                  0.0s
 => [4/5] RUN npm install -g @antfu/ni                                                                                                                                                                                     1.9s
 => ERROR [5/5] RUN nci --frozen                                                                                                                                                                                           0.2s
------
 > [5/5] RUN nci --frozen:
------
Dockerfile:9
--------------------
   7 |     # RUN npm install -g @antfu/ni@0.22.1
   8 |     
   9 | >>> RUN nci --frozen
  10 |     
  11 |     ENTRYPOINT ["nr"]
--------------------
ERROR: failed to solve: process "/bin/sh -c nci --frozen" did not complete successfully: exit code: 1
ziyue-pan commented 1 month ago

same