MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / checkYarn

Method checkYarn

lib/tasks/npm-task.js:54–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52 }
53
54 async checkYarn() {
55 try {
56 let result = await this.yarn(['--version']);
57 let version = result.stdout;
58
59 if (semver.gte(version, '2.0.0')) {
60 logger.warn('yarn --version: %s', version);
61 let yarnConfig = await this.yarn(['config', 'get', 'nodeLinker']);
62 let nodeLinker = yarnConfig.stdout.trim();
63 if (nodeLinker !== 'node-modules') {
64 this.ui.writeWarnLine(`Yarn v2 is not fully supported. Proceeding with yarn: ${version}`);
65 }
66 } else {
67 logger.info('yarn --version: %s', version);
68 }
69
70 return { name: 'yarn', version };
71 } catch (error) {
72 logger.error('yarn --version failed: %s', error);
73
74 if (error.code === 'ENOENT') {
75 throw new SilentError(
76 'Ember CLI is now using yarn, but was not able to find it.\n' +
77 'Please install yarn using the instructions at https://classic.yarnpkg.com/en/docs/install'
78 );
79 }
80
81 throw error;
82 }
83 }
84
85 async checkPNPM() {
86 try {

Callers 2

findPackageManagerMethod · 0.95
npm-task-test.jsFile · 0.80

Calls 1

yarnMethod · 0.95

Tested by

no test coverage detected