Skip to content

Commit 3af8ed7

Browse files
authored
Use path.join(os.homedir(), '.npmrc') for yarn (#44)
1 parent 8543a9e commit 3af8ed7

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/install.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22
const npmrc = require('./npmrc');
33
const env = require('./env');
4+
const path = require('path');
5+
const os = require('os');
46

57
var argv;
68
try {
@@ -9,7 +11,7 @@ try {
911
argv = process.argv;
1012
}
1113

12-
npmrc(argv, process.env.npm_config_userconfig).catch(e => {
14+
npmrc(argv, process.env.npm_config_userconfig || path.join(os.homedir(), '.npmrc')).catch(e => {
1315
if (e.code === 'EACCES' || /\bpermissions?\b/i.test(e.message)) {
1416
console.error(e.message);
1517
console.error('Please try running this command again as root/Administrator.');

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
"url": "https://github.com/gucong3000/mirror-config-china/issues"
88
},
99
"dependencies": {
10-
"fs-extra": "^6.0.0"
10+
"fs-extra": "^6.0.1"
1111
},
1212
"description": "Mirrors in China about node.js",
1313
"devDependencies": {
14-
"codecov": "^3.0.1",
15-
"eslint": "^5.0.0",
14+
"codecov": "^3.0.4",
15+
"eslint": "^5.1.0",
1616
"eslint-config-standard": "^11.0.0",
17-
"eslint-plugin-import": "^2.11.0",
17+
"eslint-plugin-import": "^2.13.0",
1818
"eslint-plugin-node": "^6.0.1",
19-
"eslint-plugin-promise": "^3.7.0",
19+
"eslint-plugin-promise": "^3.8.0",
2020
"eslint-plugin-standard": "^3.1.0",
21-
"mocha": "^5.1.1",
21+
"mocha": "^5.2.0",
2222
"nyc": "^12.0.2"
2323
},
2424
"homepage": "https://github.com/gucong3000/mirror-config-china#readme",
@@ -50,5 +50,5 @@
5050
"install-test": "npm run install && npm test",
5151
"test": "mocha --no-timeouts"
5252
},
53-
"version": "2.5.0"
53+
"version": "2.5.1"
5454
}

0 commit comments

Comments
 (0)