You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Make sure we're installing at least one package
66
66
if(program.args.length===0){
67
-
console.log(
67
+
console.error(
68
68
`${C.errorText} Please specify a package to install with peerDeps.`
69
69
);
70
70
// An exit code of "9" indicates an invalid argument
@@ -75,7 +75,7 @@ if (program.args.length === 0) {
75
75
76
76
// Make sure we're installing no more than one package
77
77
if(program.args.length>1){
78
-
console.log(
78
+
console.error(
79
79
`${C.errorText} Too many arguments. Please specify ONE package at a time to install with peerDeps. Alternatively, pass extra arguments with --extra-args "<extra_args>".`
80
80
);
81
81
// An exit code of "9" indicates an invalid argument
@@ -99,7 +99,7 @@ if (!packageName) {
99
99
letpackageManager=C.npm;// Default package manager is npm
100
100
101
101
if(program.yarn&&program.pnpm){
102
-
console.log(
102
+
console.error(
103
103
`${C.errorText} Option --yarn and --pnpm cannot be used concurrently.`
104
104
);
105
105
process.exit(9);
@@ -113,7 +113,7 @@ if (program.pnpm) {
113
113
114
114
// Yarn does not allow silent install of dependencies
115
115
if(program.yarn&&program.silent){
116
-
console.log(`${C.errorText} Option --silent cannot be used with --yarn.`);
116
+
console.error(`${C.errorText} Option --silent cannot be used with --yarn.`);
// Yarn 1 returns with an extra nested { data } that NPM doesn't
138
+
returnparsed.data||parsed;
139
+
});
140
+
});
106
141
}
107
142
108
143
/**
109
144
* Gets the contents of the package.json for a package at a specific version
110
145
* @param {Object} requestInfo - information needed to make the request for the data
111
146
* @param {string} requestInfo.packageName - the name of the package
112
147
* @param {Boolean} requestInfo.noRegistry - Gets the package dependencies list from the local node_modules instead of remote registry
113
-
* @param {string} requestInfo.packageManager - the package manager to use (Yarn or npm)
148
+
* @param {string} requestInfo.packageManager - the package manager to use
114
149
* @param {string} requestInfo.version - the version (or version tag) to attempt to install. Ignored if an installed version of the package is found in node_modules.
115
150
* @returns {Promise<Object>} - a Promise which resolves to the JSON response from the registry
0 commit comments