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:
parent
48a2e3b5b8
commit
63e3262f2f
11
bin/next
11
bin/next
|
@ -5,6 +5,17 @@ import { spawn } from 'cross-spawn'
|
||||||
import { watchFile } from 'fs'
|
import { watchFile } from 'fs'
|
||||||
import pkg from '../../package.json'
|
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 defaultCommand = 'dev'
|
||||||
const commands = new Set([
|
const commands = new Set([
|
||||||
'init',
|
'init',
|
||||||
|
|
Loading…
Reference in a new issue