mirror of
https://github.com/pnpm/pnpm.git
synced 2026-02-05 12:41:44 -05:00
Throw 'not supported' errors for package specs not supported yet
This commit is contained in:
@@ -130,6 +130,9 @@ function logger () {
|
||||
} else if (status === 'dependencies') {
|
||||
t.status(chalk.gray('' + pkgData.version + ' ·'))
|
||||
.details('')
|
||||
} else if (status === 'error') {
|
||||
t.status(chalk.red('ERROR ✗'))
|
||||
.details(args && (args.message || args))
|
||||
} else {
|
||||
t.status(status)
|
||||
.details('')
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
var chalk = require('chalk')
|
||||
|
||||
module.exports = function err (error) {
|
||||
console.error('')
|
||||
if (error.host && error.path) {
|
||||
console.error('' + error.message)
|
||||
console.error('' + error.method + ' ' + error.host + error.path)
|
||||
} else {
|
||||
console.error('Error: ' + (error.stack || error.message || error))
|
||||
console.error(chalk.red(' ! ' + (error.message || error)))
|
||||
}
|
||||
console.error('')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@ module.exports = function install (ctx, pkgSpec, modules, options) {
|
||||
fulldata: undefined
|
||||
}
|
||||
|
||||
if (!pkg.spec.name) {
|
||||
throw new Error("Not supported: '" + pkgSpec + "'")
|
||||
}
|
||||
|
||||
var paths = {
|
||||
// Module storage => './node_modules'
|
||||
modules: modules,
|
||||
|
||||
Reference in New Issue
Block a user