[BUG] Fails to run with nodejs v25

Resolved 💬 4 comments Opened Oct 17, 2025 by ismail Closed Jan 10, 2026

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?

; npx @anthropic-ai/claude-code
Need to install the following packages:
@anthropic-ai/claude-code@2.0.22
Ok to proceed? (y) y

file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:635
`),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}}Jd2.DefaultTransporter=EI1;EI1.USER_AGENT=`${Wd2}/${NJ6.version}`});var v21=U((nq0,Fd2)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var wb1=U1("buffer"),ST=wb1.Buffer;function Xd2(A,B){for(var Q in A)B[Q]=A[Q]}if(ST.from&&ST.alloc&&ST.allocUnsafe&&ST.allocUnsafeSlow)Fd2.exports=wb1;else Xd2(wb1,nq0),nq0.Buffer=yp;function yp(A,B,Q){return ST(A,B,Q)}yp.prototype=Object.create(ST.prototype);Xd2(ST,yp);yp.from=function(A,B,Q){if(typeof A==="number")throw TypeError("Argument must not be a number");return ST(A,B,Q)};yp.alloc=function(A,B,Q){if(typeof A!=="number")throw TypeError("Argument must be a number");var Z=ST(A);if(B!==void 0)if(typeof Q==="string")Z.fill(B,Q);else Z.fill(B);else Z.fill(0);return Z};yp.allocUnsafe=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return ST(A)};yp.allocUnsafeSlow=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return wb1.SlowBuffer(A)}});var Kd2=U((oP3,Vd2)=>{function aq0(A){var B=(A/8|0)+(A%8===0?0:1);return B}var LJ6={ES256:aq0(256),ES384:aq0(384),ES512:aq0(521)};function MJ6(A){var B=LJ6[A];if(B)return B;throw Error('Unknown algorithm "'+A+'"')}Vd2.exports=MJ6});var sq0=U((tP3,$d2)=>{var Nb1=v21().Buffer,Hd2=Kd2(),Lb1=128,zd2=0,OJ6=32,RJ6=16,TJ6=2,Cd2=RJ6|OJ6|zd2<<6,Mb1=TJ6|zd2<<6;function PJ6(A){return A.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ud2(A){if(Nb1.isBuffer(A))return A;else if(typeof A==="string")return Nb1.from(A,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function jJ6(A,B){A=Ud2(A);var Q=Hd2(B),Z=Q+1,G=A.length,Y=0;if(A[Y++]!==Cd2)throw Error('Could not find expected "seq"');var W=A[Y++];if(W===(Lb1|1))W=A[Y++];if(G-Y<W)throw Error('"seq" specified length of "'+W+'", only "'+(G-Y)+'" remaining');if(A[Y++]!==Mb1)throw Error('Could not find expected "int" for "r"');var J=A[Y++];if(G-Y-2<J)throw Error('"r" specified length of "'+J+'", only "'+(G-Y-2)+'" available');if(Z<J)throw Error('"r" specified length of "'+J+'", max of "'+Z+'" is acceptable');var I=Y;if(Y+=J,A[Y++]!==Mb1)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-J,K=Q-X,D=Nb1.allocUnsafe(V+J+K+X);for(Y=0;Y<V;++Y)D[Y]=0;A.copy(D,Y,I+Math.max(-V,0),I+J),Y=Q;for(var H=Y;Y<H+K;++Y)D[Y]=0;return A.copy(D,Y,F+Math.max(-K,0),F+X),D=D.toString("base64"),D=PJ6(D),D}function Dd2(A,B,Q){var Z=0;while(B+Z<Q&&A[B+Z]===0)++Z;var G=A[B+Z]>=Lb1;if(G)--Z;return Z}function SJ6(A,B){A=Ud2(A);var Q=Hd2(B),Z=A.length;if(Z!==Q*2)throw TypeError('"'+B+'" signatures must be "'+Q*2+'" bytes, saw "'+Z+'"');var G=Dd2(A,0,Q),Y=Dd2(A,Q,A.length),W=Q-G,J=Q-Y,I=2+W+1+1+J,X=I<Lb1,F=Nb1.allocUnsafe((X?2:3)+I),V=0;if(F[V++]=Cd2,X)F[V++]=I;else F[V++]=Lb1|1,F[V++]=I&255;if(F[V++]=Mb1,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++]=Mb1,F[V++]=J,Y<0)F[V++]=0,A.copy(F,V,Q);else A.copy(F,V,Q+Y);return F}$d2.exports={derToJose:jJ6,joseToDer:SJ6}});var jh=U((Ph)=>{var xL=Ph&&Ph.__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)},b21,K_,rq0,oq0;Object.defineProperty(Ph,"__esModule",{value:!0});Ph.LRUCache=void 0;Ph.snakeToCamel=qd2;Ph.originalOrCamelOptions=yJ6;function qd2(A){return A.replace(/([_][^_])/g,(B)=>B.slice(1).toUpperCase())}function yJ6(A){function B(Q){var Z;let G=A||{};return(Z=G[Q])!==null&&Z!==void 0?Z:G[qd2(Q)]}return{get:B}}class Ed2{constructor(A){b21.add(this),K_.set(this,new Map),this.capacity=A.capacity,this.maxAge=A.maxAge}set(A,B){xL(this,b21,"m",rq0).call(this,A,B),xL(this,b21,"m",oq0).call(this)}get(A){let B=xL(this,K_,"f").get(A);if(!B)return;return xL(this,b21,"m",rq0).call(this,A,B.value),xL(this,b21,"m",oq0).call(this),B.value}}Ph.LRUCache=Ed2;K_=new WeakMap,b21=new WeakSet,rq0=function(B,Q){xL(this,K_,"f").delete(B),xL(this,K_,"f").set(B,{value:Q,lastAccessed:Date.now()})},oq0=function(){let B=this.maxAge?Date.now()-this.maxAge:0,Q=xL(this,K_,"f").entries().next();while(!Q.done&&(xL(this,K_,"f").size>this.capacity||Q.value[1].lastAccessed<B))xL(this,K_,"f").delete(Q.value[0]),Q=xL(this,K_,"f").entries().next()}});var yT=U((Md2)=>{Object.defineProperty(Md2,"__esModule",{value:!0});Md2.AuthClient=Md2.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Md2.DEFAULT_UNIVERSE=void 0;var _J6=U1("events"),wd2=_L(),Nd2=wI1(),kJ6=jh();Md2.DEFAULT_UNIVERSE="googleapis.com";Md2.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300000;class Ld2 extends _J6.EventEmitter{constructor(A={}){var B,Q,Z,G,Y;super();this.credentials={},this.eagerRefreshThresholdMillis=Md2.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS,this.forceRefreshOnFailure=!1,this.universeDomain=Md2.DEFAULT_UNIVERSE;let W=(0,kJ6.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:Md2.DEFAULT_UNIVERSE,this.transporter=(G=A.transporter)!==null&&G!==void 0?G:new Nd2.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 wd2.Gaxios)return this.transporter;else if(this.transporter instanceof Nd2.DefaultTransporter)return this.transporter.instance;else if("instance"in this.transporter&&this.transporter.instance instanceof wd2.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"]}}}}Md2.AuthClient=Ld2});var eq0=U((Pd2)=>{Object.defineProperty(Pd2,"__esModule",{value:!0});Pd2.LoginTicket=void 0;class Td2{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()}}}Pd2.LoginTicket=Td2});var _p=U((yd2)=>{Object.defineProperty(yd2,"__esModule",{value:!0});yd2.OAuth2Client=yd2.ClientAuthentication=yd2.CertificateFormat=yd2.CodeChallengeMethod=void 0;var xJ6=_L(),AE0=U1("querystring"),vJ6=U1("stream"),bJ6=sq0(),BE0=k21(),fJ6=yT(),hJ6=eq0(),Sd2;(function(A){A.Plain="plain",A.S256="S256"})(Sd2||(yd2.CodeChallengeMethod=Sd2={}));var D_;(function(A){A.PEM="PEM",A.JWK="JWK"})(D_||(yd2.CertificateFormat=D_={}));var NI1;(function(A){A.ClientSecretPost="ClientSecretPost",A.ClientSecretBasic="ClientSecretBasic",A.None="None"})(NI1||(yd2.ClientAuthentication=NI1={}));class kD extends fJ6.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=D_.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||NI1.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()+"?"+AE0.stringify(A)}generateCodeVerifier(){throw Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let A=(0,BE0.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===NI1.ClientSecretBasic){let W=Buffer.from(`${this._clientId}:${this._clientSecret}`);Q.Authorization=`Basic ${W.toString("base64")}`}if(this.clientAuthentication===NI1.ClientSecretPost)Z.client_secret=this._clientSecret;let G=await this.transporter.request({...kD.RETRY_CONFIG,method:"POST",url:B,data:AE0.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({...kD.RETRY_CONFIG,method:"POST",url:Q,data:AE0.stringify(Z),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}catch(W){if(W instanceof xJ6.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 J={Authorization:"Bearer "+this.credentials.access_token};return{headers:this.addSharedMetadataHeaders(J)}}}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 J=W;if(J.response&&(J.response.status===403||J.response.status===404))J.message=`Could not refresh access token: ${J.message}`;throw J}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 kD().getRevokeTokenURL(A).toString()}getRevokeTokenURL(A){let B=new URL(this.endpoints.oauth2RevokeUrl);return B.searchParams.append("token",A),B}revokeToken(A,B){let Q={...kD.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),J=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,I=G.config.data instanceof vJ6.Readable,X=Y===401||Y===403;if(!B&&X&&!I&&W)return await this.refreshAccessTokenAsync(),this.requestAsync(A,!0);else if(!B&&X&&!I&&J){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({...kD.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,BE0.hasBrowserCrypto)()?D_.JWK:D_.PEM;if(this.certificateExpiry&&A<this.certificateExpiry.getTime()&&this.certificateCacheFormat===B)return{certs:this.certificateCache,format:B};let Q,Z;switch(B){case D_.PEM:Z=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case D_.JWK:Z=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw Error(`Unsupported certificate format ${B}`)}try{Q=await this.transporter.request({...kD.RETRY_CONFIG,url:Z})}catch(I){if(I instanceof Error)I.message=`Failed to retrieve verification certificates: ${I.message}`;throw I}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 D_.PEM:W=Q.data;break;case D_.JWK:for(let I of Q.data.keys)W[I.kid]=I;break;default:throw Error(`Unsupported certificate format ${B}`)}let J=new Date;return this.certificateExpiry=Y===-1?null:new Date(J.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({...kD.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,BE0.createCrypto)();if(!G)G=kD.DEFAULT_MAX_TOKEN_LIFETIME_SECS_;let W=A.split(".");if(W.length!==3)throw Error("Wrong number of segments in token: "+A);let J=W[0]+"."+W[1],I=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")I=bJ6.joseToDer(I,"ES256").toString("base64");if(!await Y.verify(V,J,I))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 D=Number(F.iat);if(isNaN(D))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=D-kD.CLOCK_SKEW_SECS_,q=H+kD.CLOCK_SKEW_SECS_;if(z<C)throw Error("Token used too early, "+z+" < "+C+": "+JSON.stringify(F));if(z>q)throw Error("Token used too late, "+z+" > "+q+": "+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,L=!1;if(Q.constructor===Array)L=Q.indexOf(N)>-1;else L=N===Q;if(!L)throw Error("Wrong recipient, payload audience != requiredAudience")}return new hJ6.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}}yd2.OAuth2Client=kD;kD.GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";kD.CLOCK_SKEW_SECS_=300;kD.DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400});var QE0=U((vd2)=>{Object.defineProperty(vd2,"__esModule",{value:!0});vd2.Compute=void 0;var dJ6=_L(),kd2=qI1(),cJ6=_p();class xd2 extends cJ6.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 kd2.instance(G)}catch(G){if(G instanceof dJ6.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 kd2.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}}}vd2.Compute=xd2});var ZE0=U((hd2)=>{Object.defineProperty(hd2,"__esModule",{value:!0});hd2.IdTokenClient=void 0;var lJ6=_p();class fd2 extends lJ6.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}}hd2.IdTokenClient=fd2});var GE0=U((md2)=>{Object.defineProperty(md2,"__esModule",{value:!0});md2.GCPEnv=void 0;md2.clear=pJ6;md2.getEnv=iJ6;var ud2=qI1(),H_;(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"})(H_||(md2.GCPEnv=H_={}));var LI1;function pJ6(){LI1=void 0}async function iJ6(){if(LI1)return LI1;return LI1=nJ6(),LI1}async function nJ6(){let A=H_.NONE;if(aJ6())A=H_.APP_ENGINE;else if(sJ6())A=H_.CLOUD_FUNCTIONS;else if(await tJ6())if(await oJ6())A=H_.KUBERNETES_ENGINE;else if(rJ6())A=H_.CLOUD_RUN;else A=H_.COMPUTE_ENGINE;else A=H_.NONE;return A}function aJ6(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}function sJ6(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}function rJ6(){return!!process.env.K_CONFIGURATION}async function oJ6(){try{return await ud2.instance("attributes/cluster-name"),!0}catch(A){return!1}}async function tJ6(){return ud2.isAvailable()}});var YE0=U((Wj3,cd2)=>{var Ob1=v21().Buffer,BI6=U1("stream"),QI6=U1("util");function Rb1(A){if(this.buffer=null,this.writable=!0,this.readable=!0,!A)return this.buffer=Ob1.alloc(0),this;if(typeof A.pipe==="function")return this.buffer=Ob1.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+")")}QI6.inherits(Rb1,BI6);Rb1.prototype.write=function(B){this.buffer=Ob1.concat([this.buffer,Ob1.from(B)]),this.emit("data",B)};Rb1.prototype.end=function(B){if(B)this.write(B);this.emit("end",B),this.emit("close"),this.writable=!1,this.readable=!1};cd2.exports=Rb1});var pd2=U((Jj3,ld2)=>{var MI1=U1("buffer").Buffer,WE0=U1("buffer").SlowBuffer;ld2.exports=Tb1;function Tb1(A,B){if(!MI1.isBuffer(A)||!MI1.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}Tb1.install=function(){MI1.prototype.equal=WE0.prototype.equal=function(B){return Tb1(this,B)}};var ZI6=MI1.prototype.equal,GI6=WE0.prototype.equal;Tb1.restore=function(){MI1.prototype.equal=ZI6,WE0.prototype.equal=GI6}});var XE0=U((Ij3,Ac2)=>{var YI6=pd2(),h21=v21().Buffer,_T=U1("crypto"),nd2=sq0(),id2=U1("util"),WI6=`"%s" is not a valid algorithm.


TypeError: Cannot read properties of undefined (reading 'prototype')
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:635:25327
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:635:25447
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:637:3204
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:637:6226
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:8:402
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:637:7408
    at file:///Users/ismail/.npm/_npx/becf7b9e49303068/node_modules/@anthropic-ai/claude-code/cli.js:8:402

Node.js v25.0.0

What Should Happen?

It should run Claude Code :-)

Error Messages/Logs

Steps to Reproduce

npx @anthropic-ai/claude-code, reproducible on both macOS and Linux.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.22

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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