gulpjs / gulpjs/liftoff

warn exceptions friendly

Open
#79 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
841
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Due to [the npm bug](https://github.com/npm/npm/pull/12811), 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](https://github.com/js-cli/js-liftoff/blob/master/index.js#L95). Or users will be confused for some error like [`TypeError: Invalid Version: undefined`](https://github.com/gulpjs/gulp/issues/1088).

```
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) {}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.