Skip to content

Commit e19eee6

Browse files
committed
fix(@angular/cli): address Node.js deprecation DEP0190
This approach has been recommanded by a Node.js member in nodejs/help#5063 (comment) Closes #30821 (cherry picked from commit 1a01e18)
1 parent 05e65ee commit e19eee6

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

packages/angular/cli/src/utilities/package-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export class PackageManagerUtils {
168168
return new Promise((resolve) => {
169169
const bufferedOutput: { stream: NodeJS.WriteStream; data: Buffer }[] = [];
170170

171-
const childProcess = spawn(this.name, args, {
171+
const childProcess = spawn(`${this.name} ${args.join(' ')}`, {
172172
// Always pipe stderr to allow for failures to be reported
173173
stdio: silent ? ['ignore', 'ignore', 'pipe'] : 'pipe',
174174
shell: true,

scripts/diff-release-package.mts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async function main(packageName: string) {
6464
console.log(`--> Cloned snapshot repo.`);
6565

6666
const bazelBinDir = childProcess
67-
.spawnSync(bazel, ['info', 'bazel-bin'], {
67+
.spawnSync(`${bazel} info bazel-bin`, {
6868
shell: true,
6969
encoding: 'utf8',
7070
stdio: ['pipe', 'pipe', 'inherit'],
@@ -79,15 +79,11 @@ async function main(packageName: string) {
7979
// Delete old directory to avoid surprises, or stamping being outdated.
8080
await deleteDir(outputPath);
8181

82-
childProcess.spawnSync(
83-
bazel,
84-
['build', `//packages/${targetDir}:npm_package`, '--config=snapshot'],
85-
{
86-
shell: true,
87-
stdio: 'inherit',
88-
encoding: 'utf8',
89-
},
90-
);
82+
childProcess.spawnSync(`${bazel} build //packages/${targetDir}:npm_package --config=snapshot`, {
83+
shell: true,
84+
stdio: 'inherit',
85+
encoding: 'utf8',
86+
});
9187

9288
console.log('--> Built npm package with --config=snapshot');
9389
console.error(`--> Output: ${outputPath}`);

0 commit comments

Comments
 (0)