Sh next command not found


Strange error " /bin/sh: cmdstan: command not found" when using cmdstanr in RMarkdown

jgcolman1

I am trying to write an R Markdown document that includes a Cmdstan object. If I the whole document it runs, but if I try to execute it chunk by chunk I get the error message " /bin/sh: cmdstan: command not found" when I execute the chunk containing the Stan code.

I am working in:

  • RStudio Version 2023.06.1+524 (2023.06.1+524)

  • R version 4.3.0 (2023-04-21) " Already Tomorrow"

  • cmdstanr version 0.6.0

I do not understand the error message.

Here is my MRE:

andrjohns2

When you call with no arguments, the default behaviour is to only register for processing blocks. If you want to use cmdstanr for blocks (like in your notebook), you need to instead call:

See this doc for a bit more background: R Markdown CmdStan Engine • cmdstanr

2 Likes

jgcolman3

Ah! Many thanks. I misread the first paragraph of the section on using rstan and cmdstanr together as implying that the override statement was needed only if both rstan and cmdstanr were being used.

2 Likes

jgcolman4

I’ve just had another look at the document you pointed me to. /what misled me was

Consistently getting "sh: 1: > next: not found"

I’ve been trying to tackle this issue for a couple days now and I just cant figure out whats going on. Looks like the support team is also stumped so I though hey lets reach out to the community see what they think.

Here is my problem. I’m simply trying to deploy our nextjs site on netlify and I keep getting that annoying build error.

4:03:37 PM: $ npm run build
4:03:37 PM: > op22@0.0.1 build
4:03:37 PM: > next build
4:03:37 PM: sh: 1: next: not found

I’ve made sure 100% that nextjs is installed. I’ve confirmed that the node_modules does contain next. I event rolled back to older branches and those branches seemed to deploy just fine however, when we do a diff on what changed in the package.json, there is literally 0 changes.

Here is the full log of the failing build:

4:03:11 PM: Installing NPM modules using NPM version 8.19.2
4:03:22 PM: added 1002 packages, and audited 1003 packages in 11s
4:03:22 PM: 1 high severity vulnerability
4:03:22 PM: To address all issues, run:
4:03:22 PM: npm audit fix
4:03:22 PM: Run for details.
4:03:22 PM: NPM modules installed
4:03:22 PM: Creating package sha

Next.js build fails with command not found errors

leo-p1

Hi,

I’m having trouble deploying my Next.js site on Netlify. The build fails with errors like , and .
I haven’t made any changed to the build configuration, everything was working as expected until now.
I tried deleting and recreating the website, redeploying it without cache, but the issue persists.

I configured the Netlify site using the online UI and I’m using Next.js 13.

Netlify site name: https://passliss.netlify.app/

Build settings

Runtime: Next.js
Base directory: Passliss Web/passliss
Build command: npm run build
Publish directory: Passliss Web/passliss/.next
Deploy log visibility: Logs are public
Build status: Active

Branches and deploy contexts

Production branch: vNext
Branch deploys: Deploy only the production branch
Deploy Previews: Any pull request against your production branch / branch deploy branches

Build image selection

Build image: Ubuntu Focal 20.04 (default)

Here is the deploy log:

andylemaire2

Hi @leo-p,

Welcome! Would you mind sharing the command or script which is executing?

Gr,

Andy

leo-p3

Sure, executes .

andylemaire4

Hmm ok, that’s not what I expecte

Why am I not able to start my application?

@lasjorg Thanks for your answer!

lasjorg:

That doesn’t really tell us anything, what isn’t working, how isn’t it working, what happens when you run the command?

When I run the command or or I always get this message:

lasjorg:

What happens when you run from inside the root Next.js app folder? Is the CLI not working?

No it is not working. I get the same message:

lasjorg:

I would try removing the node_modules folder and reinstalling the dependencies if not.

I already did that a few times, but nothing changed.

As I said, I am not able to start the server so I can not see an error message in the console and all I got is:

My apprehension was that I messed up something within the folder structure, but when I try to open older versions (which worked before) I get the same message.

I think I need to start a new Next JS project from scratch and then copy and paste the files into the new project and connect everything again from scretch. This should work, but anyway it would be great to know what is the probleme here.

I am able to start other projects, but this one I am not able to start any version. All versions will give

What to do when "npm run dev" is not working? (React)

kazooi1

Hi there!

I tried to start my application with “npm run dev” as it is a react / next.js app. The console gave me an error . I deleted the node_modues folder and installed it again, even then I still get this error .

I can not remeber that I changed something, so I am curious why this error appears. Can someone can help me here?

What I need to do to run my application with ?

Thanks for help!!

kazooi2

This is the error message I get when I try to start the server from npm scripts:

lasjorg3

Is the console/terminal opened in the root folder with the file? What does the part of the package.json file look like (post it).

kazooi4

Is the console/terminal opened in the root folder with the file?

What do you mean by that? I opened the terminal inside VS Code.

What does the part of the package.json file look like (post it).

This is the package.json file:

This is a Next JS boilerplate I made a few weeks before, now it is not running the command anymore. I also habe some issues with webpack, is it possible that it has something to do with that?

Thanks for help!!

lasjorg5

So if
sh next command not found