Parser failed to parse input completely

Hi I’m getting this error message when I run proven models in stan

I’m new to stan only started last week. Stan seems to parse sometimes and not others. I’ve reinstalled the package in rstudio and updated R and all packages.

PARSER FAILED TO PARSE INPUT COMPLETELY
STOPPED AT LINE 1:

Error in stanc(file = file, model_code = model_code, model_name = model_name, :
failed to parse Stan model ‘stan-3a447415ac3’ due to the above error.
Error in stanc(file = file, model_code = model_code, model_name = model_name, :
failed to parse Stan model ‘stan-3a447415ac3’ due to the above error.

Any help appreciated.

Can you post some model code that reproduces the issue for you?

Apologies, here you go
Code is embedded in the error message

PARSER FAILED TO PARSE INPUT COMPLETELY
STOPPED AT LINE 1:
write("data {
int N;
vector[N] height;
vector[N] weight_s;
vector[N] weight_s2;
}
parameters {
real alpha;
real beta1;
real beta2;
real<lower=0,upper=50> sigma;
}
model {
vector[N] mu = alpha + beta1weight_s + beta2weight_s2;
target += normal_lpdf(height | mu, sigma);
target += normal_lpdf(alpha | 140, 100);
target += normal_lpdf(beta1 | 0, 10);
target += normal_lpdf(beta2 | 0, 10);
target += uniform_lpdf(sigma | 0, 50);
}
generated quantities {
vector[N] y_rep;
for (n in 1:N){
y_rep[n] = normal_rng( alpha + beta1weight_s[n] + beta2weight_s2[n], sigma );
}
}

",“m2.stan”)

Error in stanc(file = file, model_code = model_code, model_name = model_name, :
failed to parse Stan model ‘stan-3a4756c3491’ due to the above error.
Error in stanc(file = file, model_code = model_code, model_name = model_name, :
failed to parse Stan model ‘stan-3a4756c3491’ due to the above error.