Skip to content

Commit

Permalink
Use path.join(os.homedir(), '.npmrc') for yarn (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
gucong3000 committed Jul 9, 2018
1 parent 8543a9e commit 3af8ed7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';
const npmrc = require('./npmrc');
const env = require('./env');
const path = require('path');
const os = require('os');

var argv;
try {
Expand All @@ -9,7 +11,7 @@ try {
argv = process.argv;
}

npmrc(argv, process.env.npm_config_userconfig).catch(e => {
npmrc(argv, process.env.npm_config_userconfig || path.join(os.homedir(), '.npmrc')).catch(e => {
if (e.code === 'EACCES' || /\bpermissions?\b/i.test(e.message)) {
console.error(e.message);
console.error('Please try running this command again as root/Administrator.');
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
"url": "https://github.com/gucong3000/mirror-config-china/issues"
},
"dependencies": {
"fs-extra": "^6.0.0"
"fs-extra": "^6.0.1"
},
"description": "Mirrors in China about node.js",
"devDependencies": {
"codecov": "^3.0.1",
"eslint": "^5.0.0",
"codecov": "^3.0.4",
"eslint": "^5.1.0",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.1.0",
"mocha": "^5.1.1",
"mocha": "^5.2.0",
"nyc": "^12.0.2"
},
"homepage": "https://github.com/gucong3000/mirror-config-china#readme",
Expand Down Expand Up @@ -50,5 +50,5 @@
"install-test": "npm run install && npm test",
"test": "mocha --no-timeouts"
},
"version": "2.5.0"
"version": "2.5.1"
}

0 comments on commit 3af8ed7

Please sign in to comment.