Skip to content

[BUG] NPM not recognized the env alias  #5153

@cebidanesrsi

Description

@cebidanesrsi

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

I'm migrating Docker to Podman.

I added on my env alias:

alias docker='podman'
alias docker-compose='podman-compose'

To test the alias I ran docker-compose up --build and works correctly.

I have on my package.json:

"scripts": {
    "start": "docker-compose up --build",
    ...

When a I ran npm run start, this is the output:

❯ npm run start

> project@1.0 start
> docker-compose up --build

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I did one more test, change the docker-compose to podman-compose on package.json file and works too.

Expected Behavior

Recognize the env alias. Like happen when I run the command direct on the terminal.

Steps To Reproduce

  1. Set the podman alias over docker names.
alias docker='podman'
alias docker-compose='podman-compose'
  1. Add a script on package.json to use the docker-compose.
"scripts": {
    "start": "docker-compose up --build",
    ...
  1. Run the npm script.
npm run start

Environment

  • npm: 8.13.2
  • Node.js: v14.19.3
  • OS Name: macOS 12.4 (Monterey)
  • System Model Name: Macbook Pro M1
  • npm config:
❯ npm config ls
; node bin location = /Users/XPTO/.nvm/versions/node/v14.19.3/bin/node
; node version = v14.19.3
; npm local prefix = /Users/XPTO
; npm version = 8.13.2
; cwd = /Users/XPTO
; HOME = /Users/XPTO
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions