Skip to content

2025-06-24, Version 24.3.0 (Current) #58804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 71 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
d596803
doc: add path rules and validation for export targets in package.json
0hmX Jun 9, 2025
893999e
src: replace V8 Fast API todo comment with note comment
dario-piotrowicz Jun 9, 2025
a4d7560
test: close FileHandle objects in tests explicitly
jasnell Jun 9, 2025
713fbad
test_runner: support object property mocking
idango10 Jun 9, 2025
4347ce3
src: add new CopyUtimes function to reduce code duplication
dario-piotrowicz Jun 9, 2025
dc10238
deps: update zlib to 1.3.1-470d3a2
nodejs-github-bot Jun 10, 2025
80eac14
deps: update simdjson to 3.13.0
nodejs-github-bot Jun 10, 2025
3aa2762
deps: update sqlite to 3.50.1
nodejs-github-bot Jun 10, 2025
181014a
test: cleanup status files
panva Jun 10, 2025
e9c6fa5
src: replace std::array with static arrays in contextify
mertcanaltin Jun 10, 2025
85f062c
test: deflake async-hooks/test-improper-order on AIX
bakigul1 Jun 3, 2025
7e34aa4
test: skip tests failing when run under root
LiviaMedeiros Jun 10, 2025
839964e
fs: allow correct handling of burst in fs-events with AsyncIterator
pipobscure Jun 10, 2025
450f481
deps: update amaro to 1.0.0
nodejs-github-bot Jun 11, 2025
76e3c8a
test: update WPT for es-exceptions to 2f96fa1996
nodejs-github-bot Jun 11, 2025
aa657f0
test: split indirect eval import tests
legendecas Jun 11, 2025
a3c7a63
module: allow cycles in require() in the CJS handling in ESM loader
joyeecheung Jun 11, 2025
9b28f40
module: remove experimental warning from type stripping
marco-ippolito Jun 11, 2025
fa089d6
test: update WPT for dom/abort to dc928169ee
nodejs-github-bot Jun 11, 2025
94e53d4
test: update WPT for urlpattern to 3ffda23e5a
nodejs-github-bot Jun 1, 2025
b1f60d2
http2: add diagnostics channel 'http2.server.stream.close'
RaisinTen Jun 11, 2025
b11da11
http2: fix DEP0194 message
climba03003 Jun 11, 2025
afbaf92
tools: improve release proposal linter
aduh95 Jun 11, 2025
6390f70
lib,src: support DOMException ser-des
legendecas Jun 11, 2025
b6760b3
esm: syncify default path of `ModuleLoader.load`
JakobJingleheimer Jun 11, 2025
ffff8ce
typings: add ZSTD_COMPRESS, ZSTD_DECOMPRESS to internalBinding
nektro Jun 12, 2025
45f7d16
module: refactor commonjs typescript loader
marco-ippolito Jun 12, 2025
ff8a369
module: fix typescript import.meta.main
marco-ippolito Jun 12, 2025
c1f9791
tools: edit commit-queue workflow file
aduh95 Jun 12, 2025
1cc77c7
doc: punctuation fix for Node-API versioning clarification
jiacai2050 Jun 12, 2025
268c8c1
tools: remove config.status under `make distclean`
Renegade334 Jun 12, 2025
b22e970
tools: switch to `@stylistic/eslint-plugin`
targos Jun 13, 2025
ec808b3
test: use `common.skipIfInspectorDisabled()` to skip tests
dario-piotrowicz Jun 13, 2025
dfb0144
src: enhance error messages for unknown options
pmarchini Jun 13, 2025
e6a1787
tools: bump brace-expansion from 1.1.11 to 1.1.12 in /tools/eslint
dependabot[bot] Jun 14, 2025
dc2f23e
tools: bump `brace-expansion` in `/tools/clang-format`
dependabot[bot] Jun 14, 2025
ef0230a
url: add fileURLToPathBuffer API
jasnell Jun 12, 2025
b7e488c
test: refactor repl tab complete tests
dario-piotrowicz Jun 15, 2025
c39d570
test: reduce the use of private symbols in test-events-once.js
kt3k Jun 15, 2025
17df800
typings: add Atomics primordials
Renegade334 Jun 4, 2025
704b1fa
test: add tests for REPL custom evals
dario-piotrowicz Jun 15, 2025
841609a
doc: add islandryu to collaborators
islandryu Jun 16, 2025
fb4378b
fs: add UV_ENOSPC to list of things to pass to err directly
jackyzha0 Jun 16, 2025
6f7b895
util: inspect: do not crash on an Error stack pointing to itself
SamVerschueren Jun 16, 2025
82b18ba
repl: fix tab completion not working with computer string properties
dario-piotrowicz Jun 17, 2025
c9e7b5e
test_runner: prefer `Atomics` primordials
Renegade334 Jun 4, 2025
af18c0e
fs: remove IIFE in glob
LiviaMedeiros May 21, 2025
f125310
doc: run license-builder
github-actions[bot] Jun 18, 2025
62b5879
fs: avoid computing time coefficient constants in runtime
LiviaMedeiros Jun 18, 2025
7bb1246
doc: add history entry for TS support in hooks
aduh95 Jun 18, 2025
d94b184
test: deflake test-buffer-large-size-buffer-alloc
lpinca Jun 18, 2025
68671f4
deps: upgrade npm to 11.4.2
npm-cli-bot Jun 20, 2025
6e0ee39
test: skip the test if the buffer allocation fails
lpinca Jun 20, 2025
b5ff3f4
tools: include toolchain.gypi in abseil.gyp
legendecas Jun 20, 2025
be93091
inspector: add protocol methods retrieving sent/received data
legendecas Jun 20, 2025
e2e88d4
doc: fix wrong RFC number in http2
deokjinkim Jun 20, 2025
fa6854f
deps: update amaro to 1.1.0
nodejs-github-bot Jun 20, 2025
96c78d7
fs: make `Dir` disposers idempotent
Renegade334 Jun 20, 2025
4b61f10
deps: V8: cherry-pick e3df60f3f5ab
legendecas Jun 19, 2025
081c708
lib: make domexception a native error
legendecas Jun 12, 2025
a0b1378
src: pass resource on permission checks for spawn
RafaelGSS Jun 21, 2025
8eec789
test: correct SIMD support comment
richardlau Jun 21, 2025
9df1cfe
tools: make nodedownload module compatible with Python 3.14
frenzymadness Jun 22, 2025
3faa4e8
test: deflake test-buffer-large-size-buffer-alloc-unsafe
lpinca Jun 22, 2025
d9c2b70
test: refactor repl save-load tests
dario-piotrowicz Jun 22, 2025
d0e42ff
repl: avoid deprecated `require.extensions` in tab completion
gulbaki Jun 23, 2025
6ef7329
Revert "test_runner: automatically wait for subtests to finish"
romainmenke May 11, 2025
8b0c5ed
Revert "test_runner: remove promises returned by test()"
romainmenke May 11, 2025
dce1995
Revert "test_runner: remove promises returned by t.test()"
romainmenke May 11, 2025
7cdda92
test: fix test-timeout-flag after revert of auto subtest wait
pmarchini May 14, 2025
4703ef2
2025-06-24, Version 24.3.0 (Current)
nodejs-github-bot Jun 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 12 additions & 16 deletions .github/workflows/commit-queue.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This action requires the following secrets to be set on the repository:
# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes
# JENKINS_USER: GitHub user whose Jenkins token is defined below
# JENKINS_TOKEN: Jenkins token, to be used to check CI status

name: Commit Queue
Expand Down Expand Up @@ -34,24 +34,24 @@ jobs:
id: get_mergeable_prs
run: |
prs=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--repo "$GITHUB_REPOSITORY" \
--base "$GITHUB_REF_NAME" \
--label 'commit-queue' \
--json 'number' \
--search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z") -label:blocked" \
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
fast_track_prs=$(gh pr list \
--repo ${{ github.repository }} \
--base ${{ github.ref_name }} \
--repo "$GITHUB_REPOSITORY" \
--base "$GITHUB_REF_NAME" \
--label 'commit-queue' \
--label 'fast-track' \
--search "-label:blocked" \
--json 'number' \
-t '{{ range . }}{{ .number }} {{ end }}' \
--limit 100)
numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
echo "numbers=$numbers" >> $GITHUB_OUTPUT
echo "numbers=$numbers" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
commitQueue:
Expand All @@ -61,9 +61,6 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Needs the whole git history for ncu to work
# See https://github.com/nodejs/node-core-utils/pull/486
fetch-depth: 0
# A personal token is required because pushing with GITHUB_TOKEN will
# prevent commits from running CI after they land. It needs
# to be set here because `checkout` configures GitHub authentication
Expand All @@ -80,24 +77,23 @@ jobs:

- name: Set variables
run: |
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "REPOSITORY=$(echo "$GITHUB_REPOSITORY" | cut -d/ -f2)" >> "$GITHUB_ENV"

- name: Configure @node-core/utils
run: |
ncu-config set branch ${GITHUB_REF_NAME}
ncu-config set branch "${GITHUB_REF_NAME}"
ncu-config set upstream origin
ncu-config set username "$USERNAME"
ncu-config set token "$GH_TOKEN"
ncu-config set token "$GITHUB_TOKEN"
ncu-config set jenkins_token "$JENKINS_TOKEN"
ncu-config set repo "${REPOSITORY}"
ncu-config set owner "${OWNER}"
ncu-config set owner "${GITHUB_REPOSITORY_OWNER}"
env:
USERNAME: ${{ secrets.JENKINS_USER }}
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}

- name: Start the Commit Queue
run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ needs.get_mergeable_prs.outputs.numbers }}
run: ./tools/actions/commit-queue.sh "${GITHUB_REPOSITORY_OWNER}" "${REPOSITORY}" ${{ needs.get_mergeable_prs.outputs.numbers }}
env:
GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V24.md#24.2.0">24.2.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V24.md#24.3.0">24.3.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V24.md#24.2.0">24.2.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V24.md#24.1.0">24.1.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V24.md#24.0.2">24.0.2</a><br/>
<a href="doc/changelogs/CHANGELOG_V24.md#24.0.1">24.0.1</a><br/>
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -1545,9 +1545,9 @@ The externally maintained libraries used by Node.js are:
- zlib, located at deps/zlib, is licensed as follows:
"""
zlib.h -- interface of the 'zlib' general purpose compression library
version 1.3.0.1, August xxth, 2023
version 1.3.1, January 22nd, 2024

Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ testclean: ## Remove test artifacts.
distclean: ## Remove all build and test artifacts.
$(RM) -r out
$(RM) config.gypi icu_config.gypi
$(RM) config.mk
$(RM) config.mk config.status
$(RM) -r $(NODE_EXE) $(NODE_G_EXE)
$(RM) -r node_modules
$(RM) -r deps/icu
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ For information about the governance of the Node.js project, see
**Harshitha K P** <<harshitha014@gmail.com>> (she/her)
* [himself65](https://github.com/himself65) -
**Zeyu "Alex" Yang** <<himself65@outlook.com>> (he/him)
* [islandryu](https://github.com/islandryu) -
**Ryuhei Shima** <<shimaryuhei@gmail.com>> (he/him)
* [jakecastelli](https://github.com/jakecastelli) -
**Jake Yuesong Li** <<jake.yuesong@gmail.com>> (he/him)
* [JakobJingleheimer](https://github.com/JakobJingleheimer) -
Expand Down
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.17',
'v8_embedder_string': '-node.18',

##### V8 defaults for Node.js #####

Expand Down
42 changes: 33 additions & 9 deletions deps/amaro/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Amaro

Amaro is a wrapper around `@swc/wasm-typescript`, a WebAssembly port of the SWC TypeScript parser.
It's currently used as an internal in Node.js for [Type Stripping](https://github.com/nodejs/loaders/issues/208), but in the future it will be possible to be upgraded separately by users.
The main goal of this package is to provide a stable API for TypeScript parser, which is unstable and subject to change.
It's used as an internal in Node.js for [Type Stripping](https://nodejs.org/api/typescript.html#type-stripping) but can also be used as a standalone package.

> Amaro means "bitter" in Italian. It's a reference to [Mount Amaro](https://en.wikipedia.org/wiki/Monte_Amaro_(Abruzzo)) on whose slopes this package was conceived.

This package provides a stable API for the TypeScript parser and allows users to upgrade to the latest version of TypeScript transpiler independently from the one used internally in Node.js.

## How to Install

To install Amaro, run:
Expand All @@ -31,25 +32,48 @@ It is possible to use Amaro as an external loader to execute TypeScript files.
This allows the installed Amaro to override the Amaro version used by Node.js.
In order to use Amaro as an external loader, type stripping needs to be enabled.

```bash
node --experimental-strip-types --import="amaro/register" script.ts
```

Or with the alias:
In node v23 and later you can omit the `--experimental-strip-types` flag, as it is enabled by default.

```bash
node --experimental-strip-types --import="amaro/strip" script.ts
node --experimental-strip-types --import="amaro/strip" file.ts
```

Enabling TypeScript feature transformation:

```bash
node --experimental-transform-types --import="amaro/transform" script.ts
node --experimental-transform-types --import="amaro/transform" file.ts
```

> Note that the "amaro/transform" loader should be used with `--experimental-transform-types` flag, or
> at least with `--enable-source-maps` flag, to preserve the original source maps.

#### Type stripping in dependencies

Contrary to the Node.js [TypeScript support](https://nodejs.org/docs/latest/api/typescript.html#type-stripping-in-dependencies), when used as a loader, Amaro handles TypeScript files inside folders under a `node_modules` path.

### Monorepo usage

Amaro makes working in monorepos smoother by removing the need to rebuild internal packages during development. When used with the [`--conditions`](https://nodejs.org/docs/latest/api/cli.html#-c-condition---conditionscondition) flag, you can reference TypeScript source files directly in exports:

```json
"exports": {
".": {
"typescript": "./src/index.ts",
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.js"
}
}
```

Then run your app with:

```bash
node --watch --import="amaro/strip" --conditions=typescript ./src/index.ts
```

This setup allows Node.js to load TypeScript files from linked packages without a build step. Changes to any package are picked up immediately, speeding up and simplifying local development in monorepos.

### TypeScript Version

The supported TypeScript version is 5.8.
Expand Down
13 changes: 13 additions & 0 deletions deps/amaro/dist/errors.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type SwcError = {
code: "UnsupportedSyntax" | "InvalidSyntax";
message: string;
startColumn: number;
startLine: number;
snippet: string;
filename: string;
endColumn: number;
endLine: number;
};
export declare function isSwcError(error: unknown): error is SwcError;
export declare function wrapAndReThrowSwcError(error: SwcError): never;
export {};
1 change: 1 addition & 0 deletions deps/amaro/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { transformSync } from "./transform.ts";
6 changes: 3 additions & 3 deletions deps/amaro/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deps/amaro/dist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"강동윤 <kdy1997.dev@gmail.com>"
],
"description": "wasm module for swc",
"version": "1.11.24",
"version": "1.12.1",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions deps/amaro/dist/strip-loader.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { LoadFnOutput, LoadHookContext } from "node:module";
export declare function load(url: string, context: LoadHookContext, nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>): Promise<LoadFnOutput>;
2 changes: 2 additions & 0 deletions deps/amaro/dist/transform-loader.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { LoadFnOutput, LoadHookContext } from "node:module";
export declare function load(url: string, context: LoadHookContext, nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise<LoadFnOutput>): Promise<LoadFnOutput>;
2 changes: 2 additions & 0 deletions deps/amaro/dist/transform.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type { Options, TransformOutput } from "../lib/wasm";
export declare function transformSync(source: string, options?: Options): TransformOutput;
59 changes: 59 additions & 0 deletions deps/amaro/lib/wasm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* tslint:disable */
/* eslint-disable */

export declare function transform(src: string | Uint8Array, opts?: Options): Promise<TransformOutput>;
export declare function transformSync(src: string | Uint8Array, opts?: Options): TransformOutput;
export type { Options, TransformOutput };



interface Options {
module?: boolean;
filename?: string;
mode?: Mode;
transform?: TransformConfig;
deprecatedTsModuleAsError?: boolean;
sourceMap?: boolean;
}

interface TransformConfig {
/**
* @see https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax
*/
verbatimModuleSyntax?: boolean;
/**
* Native class properties support
*/
nativeClassProperties?: boolean;
importNotUsedAsValues?: "remove" | "preserve";
/**
* Don't create `export {}`.
* By default, strip creates `export {}` for modules to preserve module
* context.
*
* @see https://github.com/swc-project/swc/issues/1698
*/
noEmptyExport?: boolean;
importExportAssignConfig?: "Classic" | "Preserve" | "NodeNext" | "EsNext";
/**
* Disables an optimization that inlines TS enum member values
* within the same module that assumes the enum member values
* are never modified.
*
* Defaults to false.
*/
tsEnumIsMutable?: boolean;
}



type Mode = "strip-only" | "transform";



interface TransformOutput {
code: string;
map?: string;
}


12 changes: 12 additions & 0 deletions deps/amaro/lib/wasm_bg.wasm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* tslint:disable */
/* eslint-disable */
export const memory: WebAssembly.Memory;
export const transform: (a: number, b: number) => number;
export const transformSync: (a: number, b: number, c: number) => void;
export const __wbindgen_export_0: (a: number) => void;
export const __wbindgen_export_1: WebAssembly.Table;
export const __wbindgen_export_2: (a: number, b: number) => number;
export const __wbindgen_export_3: (a: number, b: number, c: number, d: number) => number;
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
export const __wbindgen_export_4: (a: number, b: number, c: number) => void;
export const __wbindgen_export_5: (a: number, b: number, c: number, d: number) => void;
13 changes: 10 additions & 3 deletions deps/amaro/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "amaro",
"version": "0.5.3",
"version": "1.1.0",
"description": "Node.js TypeScript wrapper",
"license": "MIT",
"type": "commonjs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"homepage": "https://github.com/nodejs/amaro#readme",
"bugs": {
"url": "https://github.com/nodejs/amaro/issues"
Expand All @@ -13,6 +14,12 @@
"type": "git",
"url": "https://github.com/nodejs/amaro.git"
},
"keywords": [
"typescript",
"nodejs",
"type stripping",
"strip-types"
],
"scripts": {
"clean": "rimraf dist",
"lint": "biome lint --write",
Expand All @@ -21,7 +28,7 @@
"ci:fix": "biome check --write",
"prepack": "npm run build",
"postpack": "npm run clean",
"build": "node esbuild.config.mjs",
"build": "node esbuild.config.mjs && tsc --noCheck",
"build:wasm": "node tools/build-wasm.js",
"typecheck": "tsc --noEmit",
"test": "node --test \"**/*.test.js\"",
Expand All @@ -37,12 +44,12 @@
},
"exports": {
".": "./dist/index.js",
"./register": "./dist/register-strip.mjs",
"./strip": "./dist/register-strip.mjs",
"./transform": "./dist/register-transform.mjs"
},
"files": [
"dist",
"lib/**/*.d.ts",
"LICENSE.md"
],
"engines": {
Expand Down
22 changes: 19 additions & 3 deletions deps/npm/bin/npm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,27 @@ if (Test-Path $NPM_PREFIX_NPM_CLI_JS) {
$NPM_CLI_JS=$NPM_PREFIX_NPM_CLI_JS
}

# Support pipeline input
if ($MyInvocation.ExpectingInput) {
if ($MyInvocation.ExpectingInput) { # takes pipeline input
$input | & $NODE_EXE $NPM_CLI_JS $args
} else {
} elseif (-not $MyInvocation.Line) { # used "-File" argument
& $NODE_EXE $NPM_CLI_JS $args
} else { # used "-Command" argument
if ($MyInvocation.Statement) {
$NPM_ORIGINAL_COMMAND = $MyInvocation.Statement
} else {
$NPM_ORIGINAL_COMMAND = (
[Management.Automation.InvocationInfo].GetProperty('ScriptPosition', [Reflection.BindingFlags] 'Instance, NonPublic')
).GetValue($MyInvocation).Text
}

$NODE_EXE = $NODE_EXE.Replace("``", "````")
$NPM_CLI_JS = $NPM_CLI_JS.Replace("``", "````")

$NPM_NO_REDIRECTS_COMMAND = [Management.Automation.Language.Parser]::ParseInput($NPM_ORIGINAL_COMMAND, [ref] $null, [ref] $null).
EndBlock.Statements.PipelineElements.CommandElements.Extent.Text -join ' '
$NPM_ARGS = $NPM_NO_REDIRECTS_COMMAND.Substring($MyInvocation.InvocationName.Length).Trim()

Invoke-Expression "& `"$NODE_EXE`" `"$NPM_CLI_JS`" $NPM_ARGS"
}

exit $LASTEXITCODE
Loading
Loading