Skip to content

Commit 98f178c

Browse files
mseada94SBoudrias
authored andcommitted
Support NVM node-modules (yeoman#87)
1 parent 21e9baa commit 98f178c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/resolver.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const globby = require('globby');
77
const debug = require('debug')('yeoman:environment');
88

99
const win32 = process.platform === 'win32';
10+
const nvm = process.env.NVM_HOME;
1011

1112
/**
1213
* @mixin
@@ -108,7 +109,9 @@ resolver.getNpmPaths = function () {
108109
let paths = [];
109110

110111
// Default paths for each system
111-
if (win32) {
112+
if (nvm) {
113+
paths.push(path.join(process.env.NVM_HOME, process.version, 'node_modules'));
114+
} else if (win32) {
112115
paths.push(path.join(process.env.APPDATA, 'npm/node_modules'));
113116
} else {
114117
paths.push('/usr/lib/node_modules');

0 commit comments

Comments
 (0)