1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Add message for missing peerDependencies (#1187)

* Add message for missing peerDependencies

* Remove exit

* Use console.warn
This commit is contained in:
Tim Neutkens 2017-02-23 17:00:37 +01:00 committed by GitHub
parent 48a2e3b5b8
commit 63e3262f2f

View file

@ -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',