[BUG] Running any claude command immediately crashes after install on Node 24

Resolved 💬 4 comments Opened Oct 9, 2025 by ianconsolata Closed Oct 10, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

After installing and running with node 24, Claude immediately crashes. Downgrading to node v22.15.0 works, and it works again.

What Should Happen?

Claude should not crash

Error Messages/Logs

❯ npm install -g @anthropic-ai/claude-code

added 12 packages in 5s

11 packages are looking for funding
  run `npm fund` for details

~ 5s                                                                                                                                                                                               13:27:46


❯ claude doctor
file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:707
`),Q.code=Z.error.code,Q.errors=Z.error.errors;else Q.message=Z.error.message,Q.code=Z.error.code;else if(B&&B.status>=400)Q.message=Z,Q.status=B.status;return Q}}nl2.DefaultTransporter=mI1;mI1.USER_AGENT=`${il2}/${ZI6.version}`});var sA1=U((yw0,rl2)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Ob1=U1("buffer"),dR=Ob1.Buffer;function sl2(A,B){for(var Q in A)B[Q]=A[Q]}if(dR.from&&dR.alloc&&dR.allocUnsafe&&dR.allocUnsafeSlow)rl2.exports=Ob1;else sl2(Ob1,yw0),yw0.Buffer=kl;function kl(A,B,Q){return dR(A,B,Q)}kl.prototype=Object.create(dR.prototype);sl2(dR,kl);kl.from=function(A,B,Q){if(typeof A==="number")throw TypeError("Argument must not be a number");return dR(A,B,Q)};kl.alloc=function(A,B,Q){if(typeof A!=="number")throw TypeError("Argument must be a number");var Z=dR(A);if(B!==void 0)if(typeof Q==="string")Z.fill(B,Q);else Z.fill(B);else Z.fill(0);return Z};kl.allocUnsafe=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return dR(A)};kl.allocUnsafeSlow=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return Ob1.SlowBuffer(A)}});var tl2=U((aL3,ol2)=>{function _w0(A){var B=(A/8|0)+(A%8===0?0:1);return B}var GI6={ES256:_w0(256),ES384:_w0(384),ES512:_w0(521)};function YI6(A){var B=GI6[A];if(B)return B;throw Error('Unknown algorithm "'+A+'"')}ol2.exports=YI6});var kw0=U((sL3,Gp2)=>{var Rb1=sA1().Buffer,Ap2=tl2(),Tb1=128,Bp2=0,WI6=32,II6=16,JI6=2,Qp2=II6|WI6|Bp2<<6,Pb1=JI6|Bp2<<6;function XI6(A){return A.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Zp2(A){if(Rb1.isBuffer(A))return A;else if(typeof A==="string")return Rb1.from(A,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function FI6(A,B){A=Zp2(A);var Q=Ap2(B),Z=Q+1,G=A.length,Y=0;if(A[Y++]!==Qp2)throw Error('Could not find expected "seq"');var W=A[Y++];if(W===(Tb1|1))W=A[Y++];if(G-Y<W)throw Error('"seq" specified length of "'+W+'", only "'+(G-Y)+'" remaining');if(A[Y++]!==Pb1)throw Error('Could not find expected "int" for "r"');var I=A[Y++];if(G-Y-2<I)throw Error('"r" specified length of "'+I+'", only "'+(G-Y-2)+'" available');if(Z<I)throw Error('"r" specified length of "'+I+'", max of "'+Z+'" is acceptable');var J=Y;if(Y+=I,A[Y++]!==Pb1)throw Error('Could not find expected "int" for "s"');var X=A[Y++];if(G-Y!==X)throw Error('"s" specified length of "'+X+'", expected "'+(G-Y)+'"');if(Z<X)throw Error('"s" specified length of "'+X+'", max of "'+Z+'" is acceptable');var F=Y;if(Y+=X,Y!==G)throw Error('Expected to consume entire buffer, but "'+(G-Y)+'" bytes remain');var V=Q-I,D=Q-X,K=Rb1.allocUnsafe(V+I+D+X);for(Y=0;Y<V;++Y)K[Y]=0;A.copy(K,Y,J+Math.max(-V,0),J+I),Y=Q;for(var H=Y;Y<H+D;++Y)K[Y]=0;return A.copy(K,Y,F+Math.max(-D,0),F+X),K=K.toString("base64"),K=XI6(K),K}function el2(A,B,Q){var Z=0;while(B+Z<Q&&A[B+Z]===0)++Z;var G=A[B+Z]>=Tb1;if(G)--Z;return Z}function VI6(A,B){A=Zp2(A);var Q=Ap2(B),Z=A.length;if(Z!==Q*2)throw TypeError('"'+B+'" signatures must be "'+Q*2+'" bytes, saw "'+Z+'"');var G=el2(A,0,Q),Y=el2(A,Q,A.length),W=Q-G,I=Q-Y,J=2+W+1+1+I,X=J<Tb1,F=Rb1.allocUnsafe((X?2:3)+J),V=0;if(F[V++]=Qp2,X)F[V++]=J;else F[V++]=Tb1|1,F[V++]=J&255;if(F[V++]=Pb1,F[V++]=W,G<0)F[V++]=0,V+=A.copy(F,V,0,Q);else V+=A.copy(F,V,G,Q);if(F[V++]=Pb1,F[V++]=I,Y<0)F[V++]=0,A.copy(F,V,Q);else A.copy(F,V,Q+Y);return F}Gp2.exports={derToJose:FI6,joseToDer:VI6}});var cf=U((df)=>{var BL=df&&df.__classPrivateFieldGet||function(A,B,Q,Z){if(Q==="a"&&!Z)throw TypeError("Private accessor was defined without a getter");if(typeof B==="function"?A!==B||!Z:!B.has(A))throw TypeError("Cannot read private member from an object whose class did not declare it");return Q==="m"?Z:Q==="a"?Z.call(A):Z?Z.value:B.get(A)},rA1,Ly,xw0,vw0;Object.defineProperty(df,"__esModule",{value:!0});df.LRUCache=void 0;df.snakeToCamel=Yp2;df.originalOrCamelOptions=DI6;function Yp2(A){return A.replace(/([_][^_])/g,(B)=>B.slice(1).toUpperCase())}function DI6(A){function B(Q){var Z;let G=A||{};return(Z=G[Q])!==null&&Z!==void 0?Z:G[Yp2(Q)]}return{get:B}}class Wp2{constructor(A){rA1.add(this),Ly.set(this,new Map),this.capacity=A.capacity,this.maxAge=A.maxAge}set(A,B){BL(this,rA1,"m",xw0).call(this,A,B),BL(this,rA1,"m",vw0).call(this)}get(A){let B=BL(this,Ly,"f").get(A);if(!B)return;return BL(this,rA1,"m",xw0).call(this,A,B.value),BL(this,rA1,"m",vw0).call(this),B.value}}df.LRUCache=Wp2;Ly=new WeakMap,rA1=new WeakSet,xw0=function(B,Q){BL(this,Ly,"f").delete(B),BL(this,Ly,"f").set(B,{value:Q,lastAccessed:Date.now()})},vw0=function(){let B=this.maxAge?Date.now()-this.maxAge:0,Q=BL(this,Ly,"f").entries().next();while(!Q.done&&(BL(this,Ly,"f").size>this.capacity||Q.value[1].lastAccessed<B))BL(this,Ly,"f").delete(Q.value[0]),Q=BL(this,Ly,"f").entries().next()}});var cR=U((Fp2)=>{Object.defineProperty(Fp2,"__esModule",{value:!0});Fp2.AuthClient=Fp2.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Fp2.DEFAULT_UNIVERSE=void 0;var KI6=U1("events"),Ip2=eN(),Jp2=dI1(),HI6=cf();Fp2.DEFAULT_UNIVERSE="googleapis.com";Fp2.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300000;class Xp2 extends KI6.EventEmitter{constructor(A={}){var B,Q,Z,G,Y;super();this.credentials={},this.eagerRefreshThresholdMillis=Fp2.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS,this.forceRefreshOnFailure=!1,this.universeDomain=Fp2.DEFAULT_UNIVERSE;let W=(0,HI6.originalOrCamelOptions)(A);if(this.apiKey=A.apiKey,this.projectId=(B=W.get("project_id"))!==null&&B!==void 0?B:null,this.quotaProjectId=W.get("quota_project_id"),this.credentials=(Q=W.get("credentials"))!==null&&Q!==void 0?Q:{},this.universeDomain=(Z=W.get("universe_domain"))!==null&&Z!==void 0?Z:Fp2.DEFAULT_UNIVERSE,this.transporter=(G=A.transporter)!==null&&G!==void 0?G:new Jp2.DefaultTransporter,A.transporterOptions)this.transporter.defaults=A.transporterOptions;if(A.eagerRefreshThresholdMillis)this.eagerRefreshThresholdMillis=A.eagerRefreshThresholdMillis;this.forceRefreshOnFailure=(Y=A.forceRefreshOnFailure)!==null&&Y!==void 0?Y:!1}get gaxios(){if(this.transporter instanceof Ip2.Gaxios)return this.transporter;else if(this.transporter instanceof Jp2.DefaultTransporter)return this.transporter.instance;else if("instance"in this.transporter&&this.transporter.instance instanceof Ip2.Gaxios)return this.transporter.instance;return null}setCredentials(A){this.credentials=A}addSharedMetadataHeaders(A){if(!A["x-goog-user-project"]&&this.quotaProjectId)A["x-goog-user-project"]=this.quotaProjectId;return A}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}}Fp2.AuthClient=Xp2});var fw0=U((Hp2)=>{Object.defineProperty(Hp2,"__esModule",{value:!0});Hp2.LoginTicket=void 0;class Kp2{constructor(A,B){this.envelope=A,this.payload=B}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let A=this.getPayload();if(A&&A.sub)return A.sub;return null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}}Hp2.LoginTicket=Kp2});var xl=U((Up2)=>{Object.defineProperty(Up2,"__esModule",{value:!0});Up2.OAuth2Client=Up2.ClientAuthentication=Up2.CertificateFormat=Up2.CodeChallengeMethod=void 0;var zI6=eN(),hw0=U1("querystring"),CI6=U1("stream"),UI6=kw0(),gw0=nA1(),$I6=cR(),wI6=fw0(),Cp2;(function(A){A.Plain="plain",A.S256="S256"})(Cp2||(Up2.CodeChallengeMethod=Cp2={}));var My;(function(A){A.PEM="PEM",A.JWK="JWK"})(My||(Up2.CertificateFormat=My={}));var cI1;(function(A){A.ClientSecretPost="ClientSecretPost",A.ClientSecretBasic="ClientSecretBasic",A.None="None"})(cI1||(Up2.ClientAuthentication=cI1={}));class CK extends $I6.AuthClient{constructor(A,B,Q){let Z=A&&typeof A==="object"?A:{clientId:A,clientSecret:B,redirectUri:Q};super(Z);this.certificateCache={},this.certificateExpiry=null,this.certificateCacheFormat=My.PEM,this.refreshTokenPromises=new Map,this._clientId=Z.clientId,this._clientSecret=Z.clientSecret,this.redirectUri=Z.redirectUri,this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...Z.endpoints},this.clientAuthentication=Z.clientAuthentication||cI1.ClientSecretPost,this.issuers=Z.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}generateAuthUrl(A={}){if(A.code_challenge_method&&!A.code_challenge)throw Error("If a code_challenge_method is provided, code_challenge must be included.");if(A.response_type=A.response_type||"code",A.client_id=A.client_id||this._clientId,A.redirect_uri=A.redirect_uri||this.redirectUri,Array.isArray(A.scope))A.scope=A.scope.join(" ");return this.endpoints.oauth2AuthBaseUrl.toString()+"?"+hw0.stringify(A)}generateCodeVerifier(){throw Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let A=(0,gw0.createCrypto)(),Q=A.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),G=(await A.sha256DigestBase64(Q)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:Q,codeChallenge:G}}getToken(A,B){let Q=typeof A==="string"?{code:A}:A;if(B)this.getTokenAsync(Q).then((Z)=>B(null,Z.tokens,Z.res),(Z)=>B(Z,null,Z.response));else return this.getTokenAsync(Q)}async getTokenAsync(A){let B=this.endpoints.oauth2TokenUrl.toString(),Q={"Content-Type":"application/x-www-form-urlencoded"},Z={client_id:A.client_id||this._clientId,code_verifier:A.codeVerifier,code:A.code,grant_type:"authorization_code",redirect_uri:A.redirect_uri||this.redirectUri};if(this.clientAuthentication===cI1.ClientSecretBasic){let W=Buffer.from(`${this._clientId}:${this._clientSecret}`);Q.Authorization=`Basic ${W.toString("base64")}`}if(this.clientAuthentication===cI1.ClientSecretPost)Z.client_secret=this._clientSecret;let G=await this.transporter.request({...CK.RETRY_CONFIG,method:"POST",url:B,data:hw0.stringify(Z),headers:Q}),Y=G.data;if(G.data&&G.data.expires_in)Y.expiry_date=new Date().getTime()+G.data.expires_in*1000,delete Y.expires_in;return this.emit("tokens",Y),{tokens:Y,res:G}}async refreshToken(A){if(!A)return this.refreshTokenNoCache(A);if(this.refreshTokenPromises.has(A))return this.refreshTokenPromises.get(A);let B=this.refreshTokenNoCache(A).then((Q)=>{return this.refreshTokenPromises.delete(A),Q},(Q)=>{throw this.refreshTokenPromises.delete(A),Q});return this.refreshTokenPromises.set(A,B),B}async refreshTokenNoCache(A){var B;if(!A)throw Error("No refresh token is set.");let Q=this.endpoints.oauth2TokenUrl.toString(),Z={refresh_token:A,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},G;try{G=await this.transporter.request({...CK.RETRY_CONFIG,method:"POST",url:Q,data:hw0.stringify(Z),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}catch(W){if(W instanceof zI6.GaxiosError&&W.message==="invalid_grant"&&((B=W.response)===null||B===void 0?void 0:B.data)&&/ReAuth/i.test(W.response.data.error_description))W.message=JSON.stringify(W.response.data);throw W}let Y=G.data;if(G.data&&G.data.expires_in)Y.expiry_date=new Date().getTime()+G.data.expires_in*1000,delete Y.expires_in;return this.emit("tokens",Y),{tokens:Y,res:G}}refreshAccessToken(A){if(A)this.refreshAccessTokenAsync().then((B)=>A(null,B.credentials,B.res),A);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let A=await this.refreshToken(this.credentials.refresh_token),B=A.tokens;return B.refresh_token=this.credentials.refresh_token,this.credentials=B,{credentials:this.credentials,res:A.res}}getAccessToken(A){if(A)this.getAccessTokenAsync().then((B)=>A(null,B.token,B.res),A);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let Q=await this.processAndValidateRefreshHandler();if(Q===null||Q===void 0?void 0:Q.access_token)return this.setCredentials(Q),{token:this.credentials.access_token}}else throw Error("No refresh token or refresh handler callback is set.");let B=await this.refreshAccessTokenAsync();if(!B.credentials||B.credentials&&!B.credentials.access_token)throw Error("Could not refresh access token.");return{token:B.credentials.access_token,res:B.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(A){return(await this.getRequestMetadataAsync(A)).headers}async getRequestMetadataAsync(A){let B=this.credentials;if(!B.access_token&&!B.refresh_token&&!this.apiKey&&!this.refreshHandler)throw Error("No access, refresh token, API key or refresh handler callback is set.");if(B.access_token&&!this.isTokenExpiring()){B.token_type=B.token_type||"Bearer";let W={Authorization:B.token_type+" "+B.access_token};return{headers:this.addSharedMetadataHeaders(W)}}if(this.refreshHandler){let W=await this.processAndValidateRefreshHandler();if(W===null||W===void 0?void 0:W.access_token){this.setCredentials(W);let I={Authorization:"Bearer "+this.credentials.access_token};return{headers:this.addSharedMetadataHeaders(I)}}}if(this.apiKey)return{headers:{"X-Goog-Api-Key":this.apiKey}};let Q=null,Z=null;try{Q=await this.refreshToken(B.refresh_token),Z=Q.tokens}catch(W){let I=W;if(I.response&&(I.response.status===403||I.response.status===404))I.message=`Could not refresh access token: ${I.message}`;throw I}let G=this.credentials;G.token_type=G.token_type||"Bearer",Z.refresh_token=G.refresh_token,this.credentials=Z;let Y={Authorization:G.token_type+" "+Z.access_token};return{headers:this.addSharedMetadataHeaders(Y),res:Q.res}}static getRevokeTokenUrl(A){return new CK().getRevokeTokenURL(A).toString()}getRevokeTokenURL(A){let B=new URL(this.endpoints.oauth2RevokeUrl);return B.searchParams.append("token",A),B}revokeToken(A,B){let Q={...CK.RETRY_CONFIG,url:this.getRevokeTokenURL(A).toString(),method:"POST"};if(B)this.transporter.request(Q).then((Z)=>B(null,Z),B);else return this.transporter.request(Q)}revokeCredentials(A){if(A)this.revokeCredentialsAsync().then((B)=>A(null,B),A);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let A=this.credentials.access_token;if(this.credentials={},A)return this.revokeToken(A);else throw Error("No access token to revoke.")}request(A,B){if(B)this.requestAsync(A).then((Q)=>B(null,Q),(Q)=>{return B(Q,Q.response)});else return this.requestAsync(A)}async requestAsync(A,B=!1){let Q;try{let Z=await this.getRequestMetadataAsync(A.url);if(A.headers=A.headers||{},Z.headers&&Z.headers["x-goog-user-project"])A.headers["x-goog-user-project"]=Z.headers["x-goog-user-project"];if(Z.headers&&Z.headers.Authorization)A.headers.Authorization=Z.headers.Authorization;if(this.apiKey)A.headers["X-Goog-Api-Key"]=this.apiKey;Q=await this.transporter.request(A)}catch(Z){let G=Z.response;if(G){let Y=G.status,W=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),I=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,J=G.config.data instanceof CI6.Readable,X=Y===401||Y===403;if(!B&&X&&!J&&W)return await this.refreshAccessTokenAsync(),this.requestAsync(A,!0);else if(!B&&X&&!J&&I){let F=await this.processAndValidateRefreshHandler();if(F===null||F===void 0?void 0:F.access_token)this.setCredentials(F);return this.requestAsync(A,!0)}}throw Z}return Q}verifyIdToken(A,B){if(B&&typeof B!=="function")throw Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(B)this.verifyIdTokenAsync(A).then((Q)=>B(null,Q),B);else return this.verifyIdTokenAsync(A)}async verifyIdTokenAsync(A){if(!A.idToken)throw Error("The verifyIdToken method requires an ID Token");let B=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(A.idToken,B.certs,A.audience,this.issuers,A.maxExpiry)}async getTokenInfo(A){let{data:B}=await this.transporter.request({...CK.RETRY_CONFIG,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:`Bearer ${A}`},url:this.endpoints.tokenInfoUrl.toString()}),Q=Object.assign({expiry_date:new Date().getTime()+B.expires_in*1000,scopes:B.scope.split(" ")},B);return delete Q.expires_in,delete Q.scope,Q}getFederatedSignonCerts(A){if(A)this.getFederatedSignonCertsAsync().then((B)=>A(null,B.certs,B.res),A);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let A=new Date().getTime(),B=(0,gw0.hasBrowserCrypto)()?My.JWK:My.PEM;if(this.certificateExpiry&&A<this.certificateExpiry.getTime()&&this.certificateCacheFormat===B)return{certs:this.certificateCache,format:B};let Q,Z;switch(B){case My.PEM:Z=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case My.JWK:Z=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw Error(`Unsupported certificate format ${B}`)}try{Q=await this.transporter.request({...CK.RETRY_CONFIG,url:Z})}catch(J){if(J instanceof Error)J.message=`Failed to retrieve verification certificates: ${J.message}`;throw J}let G=Q?Q.headers["cache-control"]:void 0,Y=-1;if(G){let X=new RegExp("max-age=([0-9]*)").exec(G);if(X&&X.length===2)Y=Number(X[1])*1000}let W={};switch(B){case My.PEM:W=Q.data;break;case My.JWK:for(let J of Q.data.keys)W[J.kid]=J;break;default:throw Error(`Unsupported certificate format ${B}`)}let I=new Date;return this.certificateExpiry=Y===-1?null:new Date(I.getTime()+Y),this.certificateCache=W,this.certificateCacheFormat=B,{certs:W,format:B,res:Q}}getIapPublicKeys(A){if(A)this.getIapPublicKeysAsync().then((B)=>A(null,B.pubkeys,B.res),A);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let A,B=this.endpoints.oauth2IapPublicKeyUrl.toString();try{A=await this.transporter.request({...CK.RETRY_CONFIG,url:B})}catch(Q){if(Q instanceof Error)Q.message=`Failed to retrieve verification certificates: ${Q.message}`;throw Q}return{pubkeys:A.data,res:A}}verifySignedJwtWithCerts(){throw Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(A,B,Q,Z,G){let Y=(0,gw0.createCrypto)();if(!G)G=CK.DEFAULT_MAX_TOKEN_LIFETIME_SECS_;let W=A.split(".");if(W.length!==3)throw Error("Wrong number of segments in token: "+A);let I=W[0]+"."+W[1],J=W[2],X,F;try{X=JSON.parse(Y.decodeBase64StringUtf8(W[0]))}catch(N){if(N instanceof Error)N.message=`Can't parse token envelope: ${W[0]}': ${N.message}`;throw N}if(!X)throw Error("Can't parse token envelope: "+W[0]);try{F=JSON.parse(Y.decodeBase64StringUtf8(W[1]))}catch(N){if(N instanceof Error)N.message=`Can't parse token payload '${W[0]}`;throw N}if(!F)throw Error("Can't parse token payload: "+W[1]);if(!Object.prototype.hasOwnProperty.call(B,X.kid))throw Error("No pem found for envelope: "+JSON.stringify(X));let V=B[X.kid];if(X.alg==="ES256")J=UI6.joseToDer(J,"ES256").toString("base64");if(!await Y.verify(V,I,J))throw Error("Invalid token signature: "+A);if(!F.iat)throw Error("No issue time in token: "+JSON.stringify(F));if(!F.exp)throw Error("No expiration time in token: "+JSON.stringify(F));let K=Number(F.iat);if(isNaN(K))throw Error("iat field using invalid format");let H=Number(F.exp);if(isNaN(H))throw Error("exp field using invalid format");let z=new Date().getTime()/1000;if(H>=z+G)throw Error("Expiration time too far in future: "+JSON.stringify(F));let C=K-CK.CLOCK_SKEW_SECS_,w=H+CK.CLOCK_SKEW_SECS_;if(z<C)throw Error("Token used too early, "+z+" < "+C+": "+JSON.stringify(F));if(z>w)throw Error("Token used too late, "+z+" > "+w+": "+JSON.stringify(F));if(Z&&Z.indexOf(F.iss)<0)throw Error("Invalid issuer, expected one of ["+Z+"], but got "+F.iss);if(typeof Q<"u"&&Q!==null){let N=F.aud,M=!1;if(Q.constructor===Array)M=Q.indexOf(N)>-1;else M=N===Q;if(!M)throw Error("Wrong recipient, payload audience != requiredAudience")}return new wI6.LoginTicket(X,F)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let A=await this.refreshHandler();if(!A.access_token)throw Error("No access token is returned by the refreshHandler callback.");return A}return}isTokenExpiring(){let A=this.credentials.expiry_date;return A?A<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}}Up2.OAuth2Client=CK;CK.GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";CK.CLOCK_SKEW_SECS_=300;CK.DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400});var uw0=U((qp2)=>{Object.defineProperty(qp2,"__esModule",{value:!0});qp2.Compute=void 0;var LI6=eN(),wp2=uI1(),MI6=xl();class Ep2 extends MI6.OAuth2Client{constructor(A={}){super(A);this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=A.serviceAccountEmail||"default",this.scopes=Array.isArray(A.scopes)?A.scopes:A.scopes?[A.scopes]:[]}async refreshTokenNoCache(A){let B=`service-accounts/${this.serviceAccountEmail}/token`,Q;try{let G={property:B};if(this.scopes.length>0)G.params={scopes:this.scopes.join(",")};Q=await wp2.instance(G)}catch(G){if(G instanceof LI6.GaxiosError)G.message=`Could not refresh access token: ${G.message}`,this.wrapError(G);throw G}let Z=Q;if(Q&&Q.expires_in)Z.expiry_date=new Date().getTime()+Q.expires_in*1000,delete Z.expires_in;return this.emit("tokens",Z),{tokens:Z,res:null}}async fetchIdToken(A){let B=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${A}`,Q;try{let Z={property:B};Q=await wp2.instance(Z)}catch(Z){if(Z instanceof Error)Z.message=`Could not fetch ID token: ${Z.message}`;throw Z}return Q}wrapError(A){let B=A.response;if(B&&B.status){if(A.status=B.status,B.status===403)A.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+A.message;else if(B.status===404)A.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+A.message}}}qp2.Compute=Ep2});var mw0=U((Mp2)=>{Object.defineProperty(Mp2,"__esModule",{value:!0});Mp2.IdTokenClient=void 0;var OI6=xl();class Lp2 extends OI6.OAuth2Client{constructor(A){super(A);this.targetAudience=A.targetAudience,this.idTokenProvider=A.idTokenProvider}async getRequestMetadataAsync(A){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let Q=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:Q,expiry_date:this.getIdTokenExpiryDate(Q)}}return{headers:{Authorization:"Bearer "+this.credentials.id_token}}}getIdTokenExpiryDate(A){let B=A.split(".")[1];if(B)return JSON.parse(Buffer.from(B,"base64").toString("ascii")).exp*1000}}Mp2.IdTokenClient=Lp2});var dw0=U((Tp2)=>{Object.defineProperty(Tp2,"__esModule",{value:!0});Tp2.GCPEnv=void 0;Tp2.clear=RI6;Tp2.getEnv=TI6;var Rp2=uI1(),Oy;(function(A){A.APP_ENGINE="APP_ENGINE",A.KUBERNETES_ENGINE="KUBERNETES_ENGINE",A.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",A.COMPUTE_ENGINE="COMPUTE_ENGINE",A.CLOUD_RUN="CLOUD_RUN",A.NONE="NONE"})(Oy||(Tp2.GCPEnv=Oy={}));var lI1;function RI6(){lI1=void 0}async function TI6(){if(lI1)return lI1;return lI1=PI6(),lI1}async function PI6(){let A=Oy.NONE;if(jI6())A=Oy.APP_ENGINE;else if(SI6())A=Oy.CLOUD_FUNCTIONS;else if(await kI6())if(await _I6())A=Oy.KUBERNETES_ENGINE;else if(yI6())A=Oy.CLOUD_RUN;else A=Oy.COMPUTE_ENGINE;else A=Oy.NONE;return A}function jI6(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}function SI6(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}function yI6(){return!!process.env.K_CONFIGURATION}async function _I6(){try{return await Rp2.instance("attributes/cluster-name"),!0}catch(A){return!1}}async function kI6(){return Rp2.isAvailable()}});var cw0=U((ZM3,jp2)=>{var jb1=sA1().Buffer,bI6=U1("stream"),fI6=U1("util");function Sb1(A){if(this.buffer=null,this.writable=!0,this.readable=!0,!A)return this.buffer=jb1.alloc(0),this;if(typeof A.pipe==="function")return this.buffer=jb1.alloc(0),A.pipe(this),this;if(A.length||typeof A==="object")return this.buffer=A,this.writable=!1,process.nextTick(function(){this.emit("end",A),this.readable=!1,this.emit("close")}.bind(this)),this;throw TypeError("Unexpected data type ("+typeof A+")")}fI6.inherits(Sb1,bI6);Sb1.prototype.write=function(B){this.buffer=jb1.concat([this.buffer,jb1.from(B)]),this.emit("data",B)};Sb1.prototype.end=function(B){if(B)this.write(B);this.emit("end",B),this.emit("close"),this.writable=!1,this.readable=!1};jp2.exports=Sb1});var yp2=U((GM3,Sp2)=>{var pI1=U1("buffer").Buffer,lw0=U1("buffer").SlowBuffer;Sp2.exports=yb1;function yb1(A,B){if(!pI1.isBuffer(A)||!pI1.isBuffer(B))return!1;if(A.length!==B.length)return!1;var Q=0;for(var Z=0;Z<A.length;Z++)Q|=A[Z]^B[Z];return Q===0}yb1.install=function(){pI1.prototype.equal=lw0.prototype.equal=function(B){return yb1(this,B)}};var hI6=pI1.prototype.equal,gI6=lw0.prototype.equal;yb1.restore=function(){pI1.prototype.equal=hI6,lw0.prototype.equal=gI6}});var nw0=U((YM3,up2)=>{var uI6=yp2(),tA1=sA1().Buffer,lR=U1("crypto"),kp2=kw0(),_p2=U1("util"),mI6=`"%s" is not a valid algorithm.


TypeError: Cannot read properties of undefined (reading 'prototype')
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:707:25327
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:707:25447
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:3204
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:6226
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:7408
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402

Node.js v24.0.0


❯ claude --version
file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:707
`),Q.code=Z.error.code,Q.errors=Z.error.errors;else Q.message=Z.error.message,Q.code=Z.error.code;else if(B&&B.status>=400)Q.message=Z,Q.status=B.status;return Q}}nl2.DefaultTransporter=mI1;mI1.USER_AGENT=`${il2}/${ZI6.version}`});var sA1=U((yw0,rl2)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Ob1=U1("buffer"),dR=Ob1.Buffer;function sl2(A,B){for(var Q in A)B[Q]=A[Q]}if(dR.from&&dR.alloc&&dR.allocUnsafe&&dR.allocUnsafeSlow)rl2.exports=Ob1;else sl2(Ob1,yw0),yw0.Buffer=kl;function kl(A,B,Q){return dR(A,B,Q)}kl.prototype=Object.create(dR.prototype);sl2(dR,kl);kl.from=function(A,B,Q){if(typeof A==="number")throw TypeError("Argument must not be a number");return dR(A,B,Q)};kl.alloc=function(A,B,Q){if(typeof A!=="number")throw TypeError("Argument must be a number");var Z=dR(A);if(B!==void 0)if(typeof Q==="string")Z.fill(B,Q);else Z.fill(B);else Z.fill(0);return Z};kl.allocUnsafe=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return dR(A)};kl.allocUnsafeSlow=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return Ob1.SlowBuffer(A)}});var tl2=U((aL3,ol2)=>{function _w0(A){var B=(A/8|0)+(A%8===0?0:1);return B}var GI6={ES256:_w0(256),ES384:_w0(384),ES512:_w0(521)};function YI6(A){var B=GI6[A];if(B)return B;throw Error('Unknown algorithm "'+A+'"')}ol2.exports=YI6});var kw0=U((sL3,Gp2)=>{var Rb1=sA1().Buffer,Ap2=tl2(),Tb1=128,Bp2=0,WI6=32,II6=16,JI6=2,Qp2=II6|WI6|Bp2<<6,Pb1=JI6|Bp2<<6;function XI6(A){return A.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Zp2(A){if(Rb1.isBuffer(A))return A;else if(typeof A==="string")return Rb1.from(A,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function FI6(A,B){A=Zp2(A);var Q=Ap2(B),Z=Q+1,G=A.length,Y=0;if(A[Y++]!==Qp2)throw Error('Could not find expected "seq"');var W=A[Y++];if(W===(Tb1|1))W=A[Y++];if(G-Y<W)throw Error('"seq" specified length of "'+W+'", only "'+(G-Y)+'" remaining');if(A[Y++]!==Pb1)throw Error('Could not find expected "int" for "r"');var I=A[Y++];if(G-Y-2<I)throw Error('"r" specified length of "'+I+'", only "'+(G-Y-2)+'" available');if(Z<I)throw Error('"r" specified length of "'+I+'", max of "'+Z+'" is acceptable');var J=Y;if(Y+=I,A[Y++]!==Pb1)throw Error('Could not find expected "int" for "s"');var X=A[Y++];if(G-Y!==X)throw Error('"s" specified length of "'+X+'", expected "'+(G-Y)+'"');if(Z<X)throw Error('"s" specified length of "'+X+'", max of "'+Z+'" is acceptable');var F=Y;if(Y+=X,Y!==G)throw Error('Expected to consume entire buffer, but "'+(G-Y)+'" bytes remain');var V=Q-I,D=Q-X,K=Rb1.allocUnsafe(V+I+D+X);for(Y=0;Y<V;++Y)K[Y]=0;A.copy(K,Y,J+Math.max(-V,0),J+I),Y=Q;for(var H=Y;Y<H+D;++Y)K[Y]=0;return A.copy(K,Y,F+Math.max(-D,0),F+X),K=K.toString("base64"),K=XI6(K),K}function el2(A,B,Q){var Z=0;while(B+Z<Q&&A[B+Z]===0)++Z;var G=A[B+Z]>=Tb1;if(G)--Z;return Z}function VI6(A,B){A=Zp2(A);var Q=Ap2(B),Z=A.length;if(Z!==Q*2)throw TypeError('"'+B+'" signatures must be "'+Q*2+'" bytes, saw "'+Z+'"');var G=el2(A,0,Q),Y=el2(A,Q,A.length),W=Q-G,I=Q-Y,J=2+W+1+1+I,X=J<Tb1,F=Rb1.allocUnsafe((X?2:3)+J),V=0;if(F[V++]=Qp2,X)F[V++]=J;else F[V++]=Tb1|1,F[V++]=J&255;if(F[V++]=Pb1,F[V++]=W,G<0)F[V++]=0,V+=A.copy(F,V,0,Q);else V+=A.copy(F,V,G,Q);if(F[V++]=Pb1,F[V++]=I,Y<0)F[V++]=0,A.copy(F,V,Q);else A.copy(F,V,Q+Y);return F}Gp2.exports={derToJose:FI6,joseToDer:VI6}});var cf=U((df)=>{var BL=df&&df.__classPrivateFieldGet||function(A,B,Q,Z){if(Q==="a"&&!Z)throw TypeError("Private accessor was defined without a getter");if(typeof B==="function"?A!==B||!Z:!B.has(A))throw TypeError("Cannot read private member from an object whose class did not declare it");return Q==="m"?Z:Q==="a"?Z.call(A):Z?Z.value:B.get(A)},rA1,Ly,xw0,vw0;Object.defineProperty(df,"__esModule",{value:!0});df.LRUCache=void 0;df.snakeToCamel=Yp2;df.originalOrCamelOptions=DI6;function Yp2(A){return A.replace(/([_][^_])/g,(B)=>B.slice(1).toUpperCase())}function DI6(A){function B(Q){var Z;let G=A||{};return(Z=G[Q])!==null&&Z!==void 0?Z:G[Yp2(Q)]}return{get:B}}class Wp2{constructor(A){rA1.add(this),Ly.set(this,new Map),this.capacity=A.capacity,this.maxAge=A.maxAge}set(A,B){BL(this,rA1,"m",xw0).call(this,A,B),BL(this,rA1,"m",vw0).call(this)}get(A){let B=BL(this,Ly,"f").get(A);if(!B)return;return BL(this,rA1,"m",xw0).call(this,A,B.value),BL(this,rA1,"m",vw0).call(this),B.value}}df.LRUCache=Wp2;Ly=new WeakMap,rA1=new WeakSet,xw0=function(B,Q){BL(this,Ly,"f").delete(B),BL(this,Ly,"f").set(B,{value:Q,lastAccessed:Date.now()})},vw0=function(){let B=this.maxAge?Date.now()-this.maxAge:0,Q=BL(this,Ly,"f").entries().next();while(!Q.done&&(BL(this,Ly,"f").size>this.capacity||Q.value[1].lastAccessed<B))BL(this,Ly,"f").delete(Q.value[0]),Q=BL(this,Ly,"f").entries().next()}});var cR=U((Fp2)=>{Object.defineProperty(Fp2,"__esModule",{value:!0});Fp2.AuthClient=Fp2.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Fp2.DEFAULT_UNIVERSE=void 0;var KI6=U1("events"),Ip2=eN(),Jp2=dI1(),HI6=cf();Fp2.DEFAULT_UNIVERSE="googleapis.com";Fp2.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300000;class Xp2 extends KI6.EventEmitter{constructor(A={}){var B,Q,Z,G,Y;super();this.credentials={},this.eagerRefreshThresholdMillis=Fp2.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS,this.forceRefreshOnFailure=!1,this.universeDomain=Fp2.DEFAULT_UNIVERSE;let W=(0,HI6.originalOrCamelOptions)(A);if(this.apiKey=A.apiKey,this.projectId=(B=W.get("project_id"))!==null&&B!==void 0?B:null,this.quotaProjectId=W.get("quota_project_id"),this.credentials=(Q=W.get("credentials"))!==null&&Q!==void 0?Q:{},this.universeDomain=(Z=W.get("universe_domain"))!==null&&Z!==void 0?Z:Fp2.DEFAULT_UNIVERSE,this.transporter=(G=A.transporter)!==null&&G!==void 0?G:new Jp2.DefaultTransporter,A.transporterOptions)this.transporter.defaults=A.transporterOptions;if(A.eagerRefreshThresholdMillis)this.eagerRefreshThresholdMillis=A.eagerRefreshThresholdMillis;this.forceRefreshOnFailure=(Y=A.forceRefreshOnFailure)!==null&&Y!==void 0?Y:!1}get gaxios(){if(this.transporter instanceof Ip2.Gaxios)return this.transporter;else if(this.transporter instanceof Jp2.DefaultTransporter)return this.transporter.instance;else if("instance"in this.transporter&&this.transporter.instance instanceof Ip2.Gaxios)return this.transporter.instance;return null}setCredentials(A){this.credentials=A}addSharedMetadataHeaders(A){if(!A["x-goog-user-project"]&&this.quotaProjectId)A["x-goog-user-project"]=this.quotaProjectId;return A}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}}Fp2.AuthClient=Xp2});var fw0=U((Hp2)=>{Object.defineProperty(Hp2,"__esModule",{value:!0});Hp2.LoginTicket=void 0;class Kp2{constructor(A,B){this.envelope=A,this.payload=B}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let A=this.getPayload();if(A&&A.sub)return A.sub;return null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}}Hp2.LoginTicket=Kp2});var xl=U((Up2)=>{Object.defineProperty(Up2,"__esModule",{value:!0});Up2.OAuth2Client=Up2.ClientAuthentication=Up2.CertificateFormat=Up2.CodeChallengeMethod=void 0;var zI6=eN(),hw0=U1("querystring"),CI6=U1("stream"),UI6=kw0(),gw0=nA1(),$I6=cR(),wI6=fw0(),Cp2;(function(A){A.Plain="plain",A.S256="S256"})(Cp2||(Up2.CodeChallengeMethod=Cp2={}));var My;(function(A){A.PEM="PEM",A.JWK="JWK"})(My||(Up2.CertificateFormat=My={}));var cI1;(function(A){A.ClientSecretPost="ClientSecretPost",A.ClientSecretBasic="ClientSecretBasic",A.None="None"})(cI1||(Up2.ClientAuthentication=cI1={}));class CK extends $I6.AuthClient{constructor(A,B,Q){let Z=A&&typeof A==="object"?A:{clientId:A,clientSecret:B,redirectUri:Q};super(Z);this.certificateCache={},this.certificateExpiry=null,this.certificateCacheFormat=My.PEM,this.refreshTokenPromises=new Map,this._clientId=Z.clientId,this._clientSecret=Z.clientSecret,this.redirectUri=Z.redirectUri,this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...Z.endpoints},this.clientAuthentication=Z.clientAuthentication||cI1.ClientSecretPost,this.issuers=Z.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}generateAuthUrl(A={}){if(A.code_challenge_method&&!A.code_challenge)throw Error("If a code_challenge_method is provided, code_challenge must be included.");if(A.response_type=A.response_type||"code",A.client_id=A.client_id||this._clientId,A.redirect_uri=A.redirect_uri||this.redirectUri,Array.isArray(A.scope))A.scope=A.scope.join(" ");return this.endpoints.oauth2AuthBaseUrl.toString()+"?"+hw0.stringify(A)}generateCodeVerifier(){throw Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let A=(0,gw0.createCrypto)(),Q=A.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),G=(await A.sha256DigestBase64(Q)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:Q,codeChallenge:G}}getToken(A,B){let Q=typeof A==="string"?{code:A}:A;if(B)this.getTokenAsync(Q).then((Z)=>B(null,Z.tokens,Z.res),(Z)=>B(Z,null,Z.response));else return this.getTokenAsync(Q)}async getTokenAsync(A){let B=this.endpoints.oauth2TokenUrl.toString(),Q={"Content-Type":"application/x-www-form-urlencoded"},Z={client_id:A.client_id||this._clientId,code_verifier:A.codeVerifier,code:A.code,grant_type:"authorization_code",redirect_uri:A.redirect_uri||this.redirectUri};if(this.clientAuthentication===cI1.ClientSecretBasic){let W=Buffer.from(`${this._clientId}:${this._clientSecret}`);Q.Authorization=`Basic ${W.toString("base64")}`}if(this.clientAuthentication===cI1.ClientSecretPost)Z.client_secret=this._clientSecret;let G=await this.transporter.request({...CK.RETRY_CONFIG,method:"POST",url:B,data:hw0.stringify(Z),headers:Q}),Y=G.data;if(G.data&&G.data.expires_in)Y.expiry_date=new Date().getTime()+G.data.expires_in*1000,delete Y.expires_in;return this.emit("tokens",Y),{tokens:Y,res:G}}async refreshToken(A){if(!A)return this.refreshTokenNoCache(A);if(this.refreshTokenPromises.has(A))return this.refreshTokenPromises.get(A);let B=this.refreshTokenNoCache(A).then((Q)=>{return this.refreshTokenPromises.delete(A),Q},(Q)=>{throw this.refreshTokenPromises.delete(A),Q});return this.refreshTokenPromises.set(A,B),B}async refreshTokenNoCache(A){var B;if(!A)throw Error("No refresh token is set.");let Q=this.endpoints.oauth2TokenUrl.toString(),Z={refresh_token:A,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},G;try{G=await this.transporter.request({...CK.RETRY_CONFIG,method:"POST",url:Q,data:hw0.stringify(Z),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}catch(W){if(W instanceof zI6.GaxiosError&&W.message==="invalid_grant"&&((B=W.response)===null||B===void 0?void 0:B.data)&&/ReAuth/i.test(W.response.data.error_description))W.message=JSON.stringify(W.response.data);throw W}let Y=G.data;if(G.data&&G.data.expires_in)Y.expiry_date=new Date().getTime()+G.data.expires_in*1000,delete Y.expires_in;return this.emit("tokens",Y),{tokens:Y,res:G}}refreshAccessToken(A){if(A)this.refreshAccessTokenAsync().then((B)=>A(null,B.credentials,B.res),A);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let A=await this.refreshToken(this.credentials.refresh_token),B=A.tokens;return B.refresh_token=this.credentials.refresh_token,this.credentials=B,{credentials:this.credentials,res:A.res}}getAccessToken(A){if(A)this.getAccessTokenAsync().then((B)=>A(null,B.token,B.res),A);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let Q=await this.processAndValidateRefreshHandler();if(Q===null||Q===void 0?void 0:Q.access_token)return this.setCredentials(Q),{token:this.credentials.access_token}}else throw Error("No refresh token or refresh handler callback is set.");let B=await this.refreshAccessTokenAsync();if(!B.credentials||B.credentials&&!B.credentials.access_token)throw Error("Could not refresh access token.");return{token:B.credentials.access_token,res:B.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(A){return(await this.getRequestMetadataAsync(A)).headers}async getRequestMetadataAsync(A){let B=this.credentials;if(!B.access_token&&!B.refresh_token&&!this.apiKey&&!this.refreshHandler)throw Error("No access, refresh token, API key or refresh handler callback is set.");if(B.access_token&&!this.isTokenExpiring()){B.token_type=B.token_type||"Bearer";let W={Authorization:B.token_type+" "+B.access_token};return{headers:this.addSharedMetadataHeaders(W)}}if(this.refreshHandler){let W=await this.processAndValidateRefreshHandler();if(W===null||W===void 0?void 0:W.access_token){this.setCredentials(W);let I={Authorization:"Bearer "+this.credentials.access_token};return{headers:this.addSharedMetadataHeaders(I)}}}if(this.apiKey)return{headers:{"X-Goog-Api-Key":this.apiKey}};let Q=null,Z=null;try{Q=await this.refreshToken(B.refresh_token),Z=Q.tokens}catch(W){let I=W;if(I.response&&(I.response.status===403||I.response.status===404))I.message=`Could not refresh access token: ${I.message}`;throw I}let G=this.credentials;G.token_type=G.token_type||"Bearer",Z.refresh_token=G.refresh_token,this.credentials=Z;let Y={Authorization:G.token_type+" "+Z.access_token};return{headers:this.addSharedMetadataHeaders(Y),res:Q.res}}static getRevokeTokenUrl(A){return new CK().getRevokeTokenURL(A).toString()}getRevokeTokenURL(A){let B=new URL(this.endpoints.oauth2RevokeUrl);return B.searchParams.append("token",A),B}revokeToken(A,B){let Q={...CK.RETRY_CONFIG,url:this.getRevokeTokenURL(A).toString(),method:"POST"};if(B)this.transporter.request(Q).then((Z)=>B(null,Z),B);else return this.transporter.request(Q)}revokeCredentials(A){if(A)this.revokeCredentialsAsync().then((B)=>A(null,B),A);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let A=this.credentials.access_token;if(this.credentials={},A)return this.revokeToken(A);else throw Error("No access token to revoke.")}request(A,B){if(B)this.requestAsync(A).then((Q)=>B(null,Q),(Q)=>{return B(Q,Q.response)});else return this.requestAsync(A)}async requestAsync(A,B=!1){let Q;try{let Z=await this.getRequestMetadataAsync(A.url);if(A.headers=A.headers||{},Z.headers&&Z.headers["x-goog-user-project"])A.headers["x-goog-user-project"]=Z.headers["x-goog-user-project"];if(Z.headers&&Z.headers.Authorization)A.headers.Authorization=Z.headers.Authorization;if(this.apiKey)A.headers["X-Goog-Api-Key"]=this.apiKey;Q=await this.transporter.request(A)}catch(Z){let G=Z.response;if(G){let Y=G.status,W=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),I=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,J=G.config.data instanceof CI6.Readable,X=Y===401||Y===403;if(!B&&X&&!J&&W)return await this.refreshAccessTokenAsync(),this.requestAsync(A,!0);else if(!B&&X&&!J&&I){let F=await this.processAndValidateRefreshHandler();if(F===null||F===void 0?void 0:F.access_token)this.setCredentials(F);return this.requestAsync(A,!0)}}throw Z}return Q}verifyIdToken(A,B){if(B&&typeof B!=="function")throw Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(B)this.verifyIdTokenAsync(A).then((Q)=>B(null,Q),B);else return this.verifyIdTokenAsync(A)}async verifyIdTokenAsync(A){if(!A.idToken)throw Error("The verifyIdToken method requires an ID Token");let B=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(A.idToken,B.certs,A.audience,this.issuers,A.maxExpiry)}async getTokenInfo(A){let{data:B}=await this.transporter.request({...CK.RETRY_CONFIG,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:`Bearer ${A}`},url:this.endpoints.tokenInfoUrl.toString()}),Q=Object.assign({expiry_date:new Date().getTime()+B.expires_in*1000,scopes:B.scope.split(" ")},B);return delete Q.expires_in,delete Q.scope,Q}getFederatedSignonCerts(A){if(A)this.getFederatedSignonCertsAsync().then((B)=>A(null,B.certs,B.res),A);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let A=new Date().getTime(),B=(0,gw0.hasBrowserCrypto)()?My.JWK:My.PEM;if(this.certificateExpiry&&A<this.certificateExpiry.getTime()&&this.certificateCacheFormat===B)return{certs:this.certificateCache,format:B};let Q,Z;switch(B){case My.PEM:Z=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case My.JWK:Z=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw Error(`Unsupported certificate format ${B}`)}try{Q=await this.transporter.request({...CK.RETRY_CONFIG,url:Z})}catch(J){if(J instanceof Error)J.message=`Failed to retrieve verification certificates: ${J.message}`;throw J}let G=Q?Q.headers["cache-control"]:void 0,Y=-1;if(G){let X=new RegExp("max-age=([0-9]*)").exec(G);if(X&&X.length===2)Y=Number(X[1])*1000}let W={};switch(B){case My.PEM:W=Q.data;break;case My.JWK:for(let J of Q.data.keys)W[J.kid]=J;break;default:throw Error(`Unsupported certificate format ${B}`)}let I=new Date;return this.certificateExpiry=Y===-1?null:new Date(I.getTime()+Y),this.certificateCache=W,this.certificateCacheFormat=B,{certs:W,format:B,res:Q}}getIapPublicKeys(A){if(A)this.getIapPublicKeysAsync().then((B)=>A(null,B.pubkeys,B.res),A);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let A,B=this.endpoints.oauth2IapPublicKeyUrl.toString();try{A=await this.transporter.request({...CK.RETRY_CONFIG,url:B})}catch(Q){if(Q instanceof Error)Q.message=`Failed to retrieve verification certificates: ${Q.message}`;throw Q}return{pubkeys:A.data,res:A}}verifySignedJwtWithCerts(){throw Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(A,B,Q,Z,G){let Y=(0,gw0.createCrypto)();if(!G)G=CK.DEFAULT_MAX_TOKEN_LIFETIME_SECS_;let W=A.split(".");if(W.length!==3)throw Error("Wrong number of segments in token: "+A);let I=W[0]+"."+W[1],J=W[2],X,F;try{X=JSON.parse(Y.decodeBase64StringUtf8(W[0]))}catch(N){if(N instanceof Error)N.message=`Can't parse token envelope: ${W[0]}': ${N.message}`;throw N}if(!X)throw Error("Can't parse token envelope: "+W[0]);try{F=JSON.parse(Y.decodeBase64StringUtf8(W[1]))}catch(N){if(N instanceof Error)N.message=`Can't parse token payload '${W[0]}`;throw N}if(!F)throw Error("Can't parse token payload: "+W[1]);if(!Object.prototype.hasOwnProperty.call(B,X.kid))throw Error("No pem found for envelope: "+JSON.stringify(X));let V=B[X.kid];if(X.alg==="ES256")J=UI6.joseToDer(J,"ES256").toString("base64");if(!await Y.verify(V,I,J))throw Error("Invalid token signature: "+A);if(!F.iat)throw Error("No issue time in token: "+JSON.stringify(F));if(!F.exp)throw Error("No expiration time in token: "+JSON.stringify(F));let K=Number(F.iat);if(isNaN(K))throw Error("iat field using invalid format");let H=Number(F.exp);if(isNaN(H))throw Error("exp field using invalid format");let z=new Date().getTime()/1000;if(H>=z+G)throw Error("Expiration time too far in future: "+JSON.stringify(F));let C=K-CK.CLOCK_SKEW_SECS_,w=H+CK.CLOCK_SKEW_SECS_;if(z<C)throw Error("Token used too early, "+z+" < "+C+": "+JSON.stringify(F));if(z>w)throw Error("Token used too late, "+z+" > "+w+": "+JSON.stringify(F));if(Z&&Z.indexOf(F.iss)<0)throw Error("Invalid issuer, expected one of ["+Z+"], but got "+F.iss);if(typeof Q<"u"&&Q!==null){let N=F.aud,M=!1;if(Q.constructor===Array)M=Q.indexOf(N)>-1;else M=N===Q;if(!M)throw Error("Wrong recipient, payload audience != requiredAudience")}return new wI6.LoginTicket(X,F)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let A=await this.refreshHandler();if(!A.access_token)throw Error("No access token is returned by the refreshHandler callback.");return A}return}isTokenExpiring(){let A=this.credentials.expiry_date;return A?A<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}}Up2.OAuth2Client=CK;CK.GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";CK.CLOCK_SKEW_SECS_=300;CK.DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400});var uw0=U((qp2)=>{Object.defineProperty(qp2,"__esModule",{value:!0});qp2.Compute=void 0;var LI6=eN(),wp2=uI1(),MI6=xl();class Ep2 extends MI6.OAuth2Client{constructor(A={}){super(A);this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=A.serviceAccountEmail||"default",this.scopes=Array.isArray(A.scopes)?A.scopes:A.scopes?[A.scopes]:[]}async refreshTokenNoCache(A){let B=`service-accounts/${this.serviceAccountEmail}/token`,Q;try{let G={property:B};if(this.scopes.length>0)G.params={scopes:this.scopes.join(",")};Q=await wp2.instance(G)}catch(G){if(G instanceof LI6.GaxiosError)G.message=`Could not refresh access token: ${G.message}`,this.wrapError(G);throw G}let Z=Q;if(Q&&Q.expires_in)Z.expiry_date=new Date().getTime()+Q.expires_in*1000,delete Z.expires_in;return this.emit("tokens",Z),{tokens:Z,res:null}}async fetchIdToken(A){let B=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${A}`,Q;try{let Z={property:B};Q=await wp2.instance(Z)}catch(Z){if(Z instanceof Error)Z.message=`Could not fetch ID token: ${Z.message}`;throw Z}return Q}wrapError(A){let B=A.response;if(B&&B.status){if(A.status=B.status,B.status===403)A.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+A.message;else if(B.status===404)A.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+A.message}}}qp2.Compute=Ep2});var mw0=U((Mp2)=>{Object.defineProperty(Mp2,"__esModule",{value:!0});Mp2.IdTokenClient=void 0;var OI6=xl();class Lp2 extends OI6.OAuth2Client{constructor(A){super(A);this.targetAudience=A.targetAudience,this.idTokenProvider=A.idTokenProvider}async getRequestMetadataAsync(A){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let Q=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:Q,expiry_date:this.getIdTokenExpiryDate(Q)}}return{headers:{Authorization:"Bearer "+this.credentials.id_token}}}getIdTokenExpiryDate(A){let B=A.split(".")[1];if(B)return JSON.parse(Buffer.from(B,"base64").toString("ascii")).exp*1000}}Mp2.IdTokenClient=Lp2});var dw0=U((Tp2)=>{Object.defineProperty(Tp2,"__esModule",{value:!0});Tp2.GCPEnv=void 0;Tp2.clear=RI6;Tp2.getEnv=TI6;var Rp2=uI1(),Oy;(function(A){A.APP_ENGINE="APP_ENGINE",A.KUBERNETES_ENGINE="KUBERNETES_ENGINE",A.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",A.COMPUTE_ENGINE="COMPUTE_ENGINE",A.CLOUD_RUN="CLOUD_RUN",A.NONE="NONE"})(Oy||(Tp2.GCPEnv=Oy={}));var lI1;function RI6(){lI1=void 0}async function TI6(){if(lI1)return lI1;return lI1=PI6(),lI1}async function PI6(){let A=Oy.NONE;if(jI6())A=Oy.APP_ENGINE;else if(SI6())A=Oy.CLOUD_FUNCTIONS;else if(await kI6())if(await _I6())A=Oy.KUBERNETES_ENGINE;else if(yI6())A=Oy.CLOUD_RUN;else A=Oy.COMPUTE_ENGINE;else A=Oy.NONE;return A}function jI6(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}function SI6(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}function yI6(){return!!process.env.K_CONFIGURATION}async function _I6(){try{return await Rp2.instance("attributes/cluster-name"),!0}catch(A){return!1}}async function kI6(){return Rp2.isAvailable()}});var cw0=U((ZM3,jp2)=>{var jb1=sA1().Buffer,bI6=U1("stream"),fI6=U1("util");function Sb1(A){if(this.buffer=null,this.writable=!0,this.readable=!0,!A)return this.buffer=jb1.alloc(0),this;if(typeof A.pipe==="function")return this.buffer=jb1.alloc(0),A.pipe(this),this;if(A.length||typeof A==="object")return this.buffer=A,this.writable=!1,process.nextTick(function(){this.emit("end",A),this.readable=!1,this.emit("close")}.bind(this)),this;throw TypeError("Unexpected data type ("+typeof A+")")}fI6.inherits(Sb1,bI6);Sb1.prototype.write=function(B){this.buffer=jb1.concat([this.buffer,jb1.from(B)]),this.emit("data",B)};Sb1.prototype.end=function(B){if(B)this.write(B);this.emit("end",B),this.emit("close"),this.writable=!1,this.readable=!1};jp2.exports=Sb1});var yp2=U((GM3,Sp2)=>{var pI1=U1("buffer").Buffer,lw0=U1("buffer").SlowBuffer;Sp2.exports=yb1;function yb1(A,B){if(!pI1.isBuffer(A)||!pI1.isBuffer(B))return!1;if(A.length!==B.length)return!1;var Q=0;for(var Z=0;Z<A.length;Z++)Q|=A[Z]^B[Z];return Q===0}yb1.install=function(){pI1.prototype.equal=lw0.prototype.equal=function(B){return yb1(this,B)}};var hI6=pI1.prototype.equal,gI6=lw0.prototype.equal;yb1.restore=function(){pI1.prototype.equal=hI6,lw0.prototype.equal=gI6}});var nw0=U((YM3,up2)=>{var uI6=yp2(),tA1=sA1().Buffer,lR=U1("crypto"),kp2=kw0(),_p2=U1("util"),mI6=`"%s" is not a valid algorithm.


TypeError: Cannot read properties of undefined (reading 'prototype')
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:707:25327
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:707:25447
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:3204
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:6226
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:7408
    at file:///Users/i/.nvm/versions/node/v24.0.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:402

Node.js v24.0.0

Steps to Reproduce

  1. Install Claude Code npm package globally with node 24
  2. Run claude command

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

node 22

Claude Code Version

unknown

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗