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

Add message for missing peerDependencies #1187

Merged
merged 5 commits into from
Feb 23, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove exit
  • Loading branch information
timweprovide committed Feb 18, 2017
commit 3a24c6504510b574604f42de0d9a9a000f8bf49e
7 changes: 0 additions & 7 deletions bin/next
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@ import { watchFile } from 'fs'
import pkg from '../../package.json'

if (pkg.peerDependencies) {
let peerDependencyUnavailable = false

Object.keys(pkg.peerDependencies).forEach(dependency => {
try {
// When 'npm link' is used it checks the clone location. Not the project.
require.resolve(dependency)
} catch (err) {
console.log(`${dependency} not found. Please install ${dependency} using 'npm install ${dependency}'`)
Copy link
Member

@rauchg rauchg Feb 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.error ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or warn 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one 🙌

peerDependencyUnavailable = true
}
})

if (peerDependencyUnavailable) {
process.exit(1)
}
}

const defaultCommand = 'dev'
Expand Down