Skip to content

Commit

Permalink
Add message for missing peerDependencies (vercel#1187)
Browse files Browse the repository at this point in the history
* Add message for missing peerDependencies

* Remove exit

* Use console.warn
  • Loading branch information
timneutkens authored Feb 23, 2017
1 parent 48a2e3b commit 63e3262
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/next
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ import { spawn } from 'cross-spawn'
import { watchFile } from 'fs'
import pkg from '../../package.json'

if (pkg.peerDependencies) {
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.warn(`${dependency} not found. Please install ${dependency} using 'npm install ${dependency}'`)
}
})
}

const defaultCommand = 'dev'
const commands = new Set([
'init',
Expand Down

0 comments on commit 63e3262

Please sign in to comment.