You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The environment variable `npm_config_registry` takes precedence to the registry configured in `.npmrc` when running `npm` commands.
Yarn set this variable to `https://registry.yarnpkg.com` creating an `EINVALIDNPMTOKEN` error when running `semantic-release` with Yarn.
Passing `--registry` with the value retrieved from `.npmrc` or `package.json` override the `npm_config_registry` set by Yarn.
// Change current working directory to a temp directory
20
18
process.chdir(tempy.directory());
21
-
// Prevent to use `.npmrc` from the home directory in case there is a valid token set there
22
-
process.env.HOME=process.cwd();
23
-
process.env.USERPROFILE=process.cwd();
24
19
// Stub the logger
25
20
t.context.log=stub();
26
21
t.context.logger={log: t.context.log};
27
22
});
28
23
29
24
test.afterEach.always(t=>{
30
-
// Clear `rc` from the npm cache as it cache the relative path of .npmrc files, preventing to load a new file after changing current working directory. See https://github.com/dominictarr/rc/issues/101
31
-
clearModule('rc');
32
25
// Restore process.env
33
26
process.env=Object.assign({},t.context.env);
34
27
// Restore the current working directory
35
28
process.chdir(t.context.cwd);
36
29
});
37
30
38
-
test.serial('Set auth with "NPM_TOKEN" and default registry',asynct=>{
0 commit comments