Skip to content
Merged
Changes from all commits
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
10 changes: 9 additions & 1 deletion packages/@vue/cli/lib/util/ProjectPackageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const execa = require('execa')
const minimist = require('minimist')
const semver = require('semver')
const LRU = require('lru-cache')
const chalk = require('chalk')

const {
hasYarn,
Expand All @@ -13,6 +14,7 @@ const {
hasProjectPnpm
} = require('@vue/cli-shared-utils/lib/env')
const { isOfficialPlugin, resolvePluginId } = require('@vue/cli-shared-utils/lib/pluginResolution')
const { log, warn } = require('@vue/cli-shared-utils/lib/logger')

const { loadOptions } = require('../options')
const getPackageJson = require('./getPackageJson')
Expand Down Expand Up @@ -76,7 +78,13 @@ class PackageManager {
}

if (!SUPPORTED_PACKAGE_MANAGERS.includes(this.bin)) {
throw new Error(`Unknown package manager: ${this.bin}`)
log()
warn(
`The package manager ${chalk.red(this.bin)} is ${chalk.red('not officially supported')}.\n` +
`It will be treated like ${chalk.cyan('npm')}, but compatibility issues may occur.\n` +
`See if you can use ${chalk.cyan('--registry')} instead.`
)
PACKAGE_MANAGER_CONFIG[this.bin] = PACKAGE_MANAGER_CONFIG.npm
}
}

Expand Down