Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ShellJS doesn't respect NPM Registry being set outside of it #761

@Aghassi

Description

@Aghassi

Node version (or tell us if you're using electron or some other framework): 8.1.4

ShellJS version (the most recent version/Github branch you see the bug on): 0.7.8

Operating system: macOS 10.12.6

Description of the bug:

In a CI environment (CircleCI), my company is required to set both the registry and the https-proxy of the .npmrc file. These settings are not carried into the environment shelljs operates in. I know this because I start getting timeouts when trying to run yarn or npm install when running via shell.exec

Example ShellJS command to reproduce the error:

I can't provide exact registries or proxies since they are internal, so I will provide the "scenario" or "conditions" under which this would happen.

 npm config set registry https://registry.npmjs.company.net
 npm config set https-proxy http://special.proxy.here
 yarn test

And yarn test would run some script that had

shell.cd(project);  // This is a project we cloned into the existing project
shell.exec(`yarn`);

In this case, ShellJS's environment will not have the registry variables we set. In addition, running -g for the registry variables does not fix the issue. At this point, the only solution is to have shelljs set the registry again in the script. This defeats the purpose of setting it outside of the script.

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