Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warn exceptions friendly #79

Open
chinesedfan opened this issue Jul 20, 2016 · 0 comments
Open

warn exceptions friendly #79

chinesedfan opened this issue Jul 20, 2016 · 0 comments

Comments

@chinesedfan
Copy link

Due to the npm bug, wrong version of glob may be installed. For example, if add glob 7 in devDependencies, it will cause ENOTDIR invalid cwd error.

It's better to warn exceptions friendly in following codes. Or users will be confused for some error like TypeError: Invalid Version: undefined.

  var modulePath, modulePackage;
  try {
    var delim = (process.platform === 'win32' ? ';' : ':'),
        paths = (process.env.NODE_PATH ? process.env.NODE_PATH.split(delim) : []);
    modulePath = resolve.sync(this.moduleName, {basedir: configBase || cwd, paths: paths});
    modulePackage = silentRequire(fileSearch('package.json', [modulePath]));
  } catch (e) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant