Skip to content

Commit

Permalink
add warning from issue yarnpkg#2495
Browse files Browse the repository at this point in the history
  • Loading branch information
mnsn committed Jan 28, 2017
1 parent 6a29bfe commit 8a25957
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 38 deletions.
6 changes: 5 additions & 1 deletion src/cli/commands/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ const {run, setFlags: _setFlags} = buildSubCommands('global', {
await updateCwd(config);

const updateBins = await initUpdateBins(config, reporter, flags);


if (args.includes('yarn')) {
reporter.warn(reporter.lang('packageContainsYarnAsGlobal'));

}
// install module
const lockfile = await Lockfile.fromDirectory(config.cwd);
const install = new GlobalAdd(args, flags, config, reporter, lockfile);
Expand Down
74 changes: 37 additions & 37 deletions src/reporters/lang/en.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* @flow */
/* eslint max-len: 0 */
/* eslint max-len: 0 */

const messages = {
upToDate: 'Already up-to-date.',
Expand All @@ -20,7 +20,7 @@ const messages = {
offlineRetrying: 'There appears to be trouble with your network connection. Retrying...',
clearedCache: 'Cleared cache.',
packWroteTarball: 'Wrote tarball to $0.',

manifestPotentialTypo: 'Potential typo $0, did you mean $1?',
manifestBuiltinModule: '$0 is also the name of a node core module',
manifestNameDot: "Name can't start with a dot",
Expand All @@ -31,23 +31,23 @@ const messages = {
manifestStringExpected: '$0 is not a string',
manifestDependencyCollision: '$0 has dependency $1 with range $2 that collides with a dependency in $3 of the same name with version $4',
manifestDirectoryNotFound: 'Unable to read $0 directory of module $1',

verboseFileCopy: 'Copying $0 to $1.',
verboseFileSymlink: 'Creating symlink at $0 to $1.',
verboseFileSkip: 'Skipping copying of file $0 as the file at $1 is the same size ($2) and mtime ($3).',
verboseFileSkipSymlink: 'Skipping copying of $0 as the file at $1 is the same symlink ($2).',
verboseFileRemoveExtraneous: 'Removing extraneous file $0.',
verboseFilePhantomExtraneous: "File $0 would be marked as extraneous but has been removed as it's listed as a phantom file.",
verboseFileFolder: 'Creating directory $0.',

verboseRequestStart: 'Performing $0 request to $1.',
verboseRequestFinish: 'Request $0 finished with status code $1.',

configSet: 'Set $0 to $1.',
configDelete: 'Deleted $0.',
configNpm: 'npm config',
configYarn: 'yarn config',

couldntFindPackagejson: "Couldn't find a package.json file in $0",
couldntFindMatch: "Couldn't find match for $0 in $1 for $2.",
couldntFindPackageInCache: "Couldn't find any versions for $0 that matches $1 in our cache. Possible versions: $2",
Expand Down Expand Up @@ -91,15 +91,15 @@ const messages = {
allDependenciesUpToDate: 'All of your dependencies are up to date.',
frozenLockfileError: 'Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.',
fileWriteError: 'Could not write file $0: $1',

yarnOutdated: "Your current version of Yarn is out of date. The latest version is $0 while you're on $1.",
yarnOutdatedInstaller: 'To upgrade, download the latest installer at $0.',
yarnOutdatedCommand: 'To upgrade, run the following command:',

tooManyArguments: 'Too many arguments, maximum of $0.',
tooFewArguments: 'Not enough arguments, expected at least $0.',
noArguments: "This command doesn't require any arguments.",

ownerRemoving: 'Removing owner $0 from package $1.',
ownerRemoved: 'Owner removed.',
ownerRemoveError: "Couldn't remove owner.",
Expand All @@ -110,73 +110,73 @@ const messages = {
ownerAdding: 'Adding owner $0 to package $1',
ownerAddingFailed: "Couldn't add owner.",
ownerNone: 'No owners.',

teamCreating: 'Creating team',
teamRemoving: 'Removing team',
teamAddingUser: 'Adding user to team',
teamRemovingUser: 'Removing user from team',
teamListing: 'Listing teams',

cleaning: 'Cleaning modules',
cleanCreatingFile: 'Creating $0',

binLinkCollision: "There's already a linked binary called $0 in your global Yarn bin. Could not link this package's $0 bin entry.",
linkCollision: "There's already a module called $0 registered.",
linkMissing: 'No registered module found called $0.',
linkInstallMessage: 'You can now run `yarn link $0` in the projects where you want to use this module and it will be used instead.',
linkRegistered: 'Registered $0.',
linkUnregistered: 'Unregistered $0.',
linkUsing: 'Using linked module for $0.',

commandNotSpecified: 'No command specified.',
binCommands: 'Commands available from binary scripts: ',
possibleCommands: 'Project commands',
commandQuestion: 'Which command would you like to run?',
commandFailed: 'Command failed with exit code $0.',

foundIncompatible: 'Found incompatible module',
incompatibleEngine: 'The engine $0 is incompatible with this module. Expected version $1.',
incompatibleCPU: 'The CPU architecture $0 is incompatible with this module.',
incompatibleOS: 'The platform $0 is incompatible with this module.',
invalidEngine: 'The engine $0 appears to be invalid.',

selfUpdateReleased: 'Replaced current release with $0.',
selfUpdateDownloading: 'Downloading yarn version $0.',
selfUpdateNoNewer: 'Yarn is already using the latest version.',

optionalCompatibilityExcluded: '$0 is an optional dependency and failed compatibility check. Excluding it from installation.',
optionalModuleFail: 'This module is OPTIONAL, you can safely ignore this error',
optionalModuleScriptFail: 'Error running install script for optional dependency: $0',
optionalModuleCleanupFail: 'Could not cleanup build artifacts from failed install: $0',

unmetPeer: '$0 has unmet peer dependency $1.',
incorrectPeer: '$0 has incorrect peer dependency $1.',

savedNewDependency: 'Saved 1 new dependency.',
savedNewDependencies: 'Saved $0 new dependencies.',

foundWarnings: 'Found $0 warnings.',
foundErrors: 'Found $0 errors.',

savedLockfile: 'Saved lockfile.',
noRequiredLockfile: 'No lockfile in this directory. Run `yarn install` to generate one.',
noLockfileFound: 'No lockfile found.',

invalidSemver: 'Invalid semver version',
newVersion: 'New version',
currentVersion: 'Current version',

manualVersionResolution: 'Unable to find a suitable version for $0, please choose one by typing one of the numbers below:',
manualVersionResolutionOption: '$0 which resolved to $1',

createdTag: 'Created tag.',
createdTagFail: "Couldn't add tag.",
deletedTag: 'Deleted tag.',
deletedTagFail: "Couldn't delete tag.",
gettingTags: 'Getting tags',
deletingTags: 'Deleting tag',
creatingTag: 'Creating tag $0 = $1',

whyStart: 'Why do we have the module $0?',
whyFinding: 'Finding dependency',
whyCalculating: 'Calculating file sizes',
Expand All @@ -188,46 +188,46 @@ const messages = {
whyDiskSizeTransitive: 'Disk size with transitive dependencies: $0',
whySharedDependencies: 'Amount of shared dependencies: $0',
whyHoistedTo: `Has been hoisted to $0`,

whyHoistedFromSimple: `This module exists because it's hoisted from $0.`,
whyDependedOnSimple: `This module exists because $0 depends on it.`,
whySpecifiedSimple: `This module exists because it's specified in $0.`,
whyReasons: 'Reasons this module exists',
whyHoistedFrom: 'Hoisted from $0',
whyDependedOn: '$0 depends on it',
whySpecified: `Specified in $0`,

uninstalledPackages: 'Uninstalled packages.',
uninstallRegenerate: 'Regenerating lockfile and installing missing dependencies',

cleanRemovedFiles: 'Removed $0 files',
cleanSavedSize: 'Saved $0 MB.',

npmUsername: 'npm username',
npmPassword: 'npm password',
npmEmail: 'npm email',

loggingIn: 'Logging in',
loggedIn: 'Logged in.',
notRevokingEnvToken: 'Not revoking login token, specified via environment variable.',
notRevokingConfigToken: 'Not revoking login token, specified via config file.',
noTokenToRevoke: 'No login token to revoke.',
revokingToken: 'Revoking token',
revokedToken: 'Revoked login token.',

loginAsPublic: 'Logging in as public',
incorrectCredentials: 'Incorrect username or password.',
clearedCredentials: 'Cleared login credentials.',

publishSame: 'New version is the same as the current version.',
publishFail: "Couldn't publish package.",
publishPrivate: 'Package marked as private, not publishing.',
published: 'Published.',
publishing: 'Publishing',

infoFail: 'Received invalid response from npm.',
malformedRegistryResponse: 'Received malformed response from registry for $0. The registry may be down.',

cantRequestOffline: 'Can\'t make a request in offline mode',
requestManagerNotSetupHAR: 'RequestManager was not setup to capture HAR files',
requestError: 'Request $0 returned a $1',
Expand All @@ -238,17 +238,16 @@ const messages = {
errorDecompressingTarball: '$0. Error decompressing $1, it appears to be corrupt.',
updateInstalling: 'Installing $0...',
hostedGitResolveError: 'Error connecting to repository. Please, check the url.',

unknownFetcherFor: 'Unknown fetcher for $0',

refusingDownloadGitWithoutCommit: 'Refusing to download the git repo $0 over plain git without a commit hash',
refusingDownloadHTTPWithoutCommit: 'Refusing to download the git repo $0 over HTTP without a commit hash',
refusingDownloadHTTPSWithoutCommit: 'Refusing to download the git repo $0 over HTTPS without a commit hash - possible certificate error?',

packageInstalledWithBinaries: 'Installed $0 with binaries:',
packageHasBinaries: '$0 has binaries:',
packageHasNoBinaries: '$0 has no binaries',

couldBeDeduped: '$0 could be deduped from $1 to $2',
lockfileNotContainPatter: 'Lockfile does not contain pattern: $0',
integrityHashesDontMatch: 'Integrity hashes don\'t match, expected $0 but got $1',
Expand All @@ -257,6 +256,7 @@ const messages = {
optionalDepNotInstalled: 'Optional dependency $0 not installed',
packageWrongVersion: '$0 is wrong version: expected $1, got $2',
packageDontSatisfy: '$0 doesn\'t satisfy found match of $1',
packageContainsYarnAsGlobal: 'installing Yarn via Yarn will result in you having two separate versions of Yarn installed at the same time.',
};

export type LanguageKeys = $Keys<typeof messages>;
Expand Down

0 comments on commit 8a25957

Please sign in to comment.