Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Run-script commands don't load environment vars with WSL #15

@boycce

Description

@boycce

Hi there,

Run-script doesn't seem to be setting environment variables when using WSL, but works fine for Mingw64.
Maybe it has to do with process.platform being set to 'linux' in contrast to Mingw64 setting it to 'win32'.

Node: 8.11.1
NPM: 5.8.0
OS: Windows 10 64bit

Steps to reproduce:

  1. npm config set script-shell C:\\Windows\\System32\\bash.exe
  2. Add to package.json: "scripts": { "printenv": "printenv" }
  3. npm run printenv

Result:

TERM=xterm-256color
SHELL=/bin/bash
NAME=compy
USER=ricky
HOSTTYPE=x86_64
PATH=...
_=/usr/bin/printenv
PWD=/mnt/c/Users/ricky
LANG=en_US.UTF-8
HOME=/home/ricky
SHLVL=2
LOGNAME=ricky

Expected:

npm_config_x and npm_package_x variables to also be set, so I can use them inside of run-script commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions