Skip to content
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

Operation not permitted #15369

Open
Gamusadev opened this issue Nov 23, 2024 · 1 comment
Open

Operation not permitted #15369

Gamusadev opened this issue Nov 23, 2024 · 1 comment
Labels
bug Something isn't working needs investigate Needs to be investigated to find the root cause

Comments

@Gamusadev
Copy link

Gamusadev commented Nov 23, 2024

What version of Bun is running?

1.1.34

What platform is your computer?

x64

$ neofetch

OS: Garuda Linux Bird of Prey x86_64

What steps can reproduce the bug?

In my garuda linux x64, when I was trying to create a react app using the below commands
bun create react-app appname
or
bun create vite appname

What is the expected behavior?

No response

What do you see instead?

I am getting the bellow error:

$ bun create vite appname 

2 | `)).join(`
3 | `)}),be}var we,bt;function Ci(){return bt||(bt=1,we=(e,o,c)=>{c=c||o;let t=Math.min(o-c,e-Math.floor(c/2));t<0&&(t=0);let l=Math.min(t+c,o);return{startIndex:t,endIndex:l}}),we}var ye,wt;function _(){return wt||(wt=1,ye={action:xi(),clear:Si(),style:$i(),strip:de(),figures:mt(),lines:Ei(),wrap:Ti(),entriesToDisplay:Ci()}),ye}var xe,yt;function N(){if(yt)return xe;yt=1;const e=ei,{action:o}=_(),c=ti,{beep:t,cursor:l}=q(),a=P();class r extends c{constructor(i={}){super(),this.firstRender=!0,this.in=i.stdin||process.stdin,this.out=i.stdout||process.stdout,this.onRender=(i.onRender||(()=>{})).bind(this);const n=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);const s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,u=(m,h)=>{let d=o(h,s);d===!1?this._&&this._(m,h):typeofthis[d]=="function"?this[d](h):this.bell()};this.close=()=>{this.out.write(l.show),this.in.removeListener("keypress",u),this.in.isTTY&&this.in.setR | ... truncated
4 | `),this.close()}async validate(){let s=await this.validator(this.value);typeof s=="string"&&(this.errorMsg=s,s=!1),this.error=!s}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
5 | `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(s){this.placeholder||(this.cursor=this.cursor+s,this.cursorOffset+=s)}_(s,u){let m=this.value.slice(0,this.cursor),h=this.value.slice(this.cursor);this.value=`${m}${s}${h}`,this.red=!1,this.cursor=this.placeholder?0:m.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let s=this.value.slice(0,this.cursor-1),u=this.value.slice(this.cursor);this.value=`${s}${u}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let s=this.value.slice(0,this.cursor),u=this.value.slice(this.cursor+1);this.value=`${s}${u}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render( | ... truncated
6 | `).reduce((s,u,m)=>s+`
7 | ${m?" ":f.pointerSmall} ${e.red().italic(u)}`,"")),this.out.write(c.line+t.to(0)+this.outputText+t.save+this.outputError+t.restore+t.move(this.cursorOffset,0)))}}return Se=i,Se}var $e,St;function Oi(){if(St)return $e;St=1;const e=P(),o=N(),{style:c,clear:t,figures:l,wrap:a,entriesToDisplay:r}=_(),{cursor:f}=q();class i extends o{constructor(s={}){super(s),this.msg=s.message,this.hint=s.hint||"- Use arrow-keys. Return to submit.",this.warn=s.warn||"- This option is disabled",this.cursor=s.initial||0,this.choices=s.choices.map((u,m)=>(typeof u=="string"&&(u={title:u,value:m}),{title:u&&(u.title||u.value||u),value:u&&(u.value===void 0?m:u.value),description:u&&u.description,selected:u&&u.selected,disabled:u&&u.disabled})),this.optionsPerPage=s.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=t("",this.out.columns),this.render()}moveCursor(s){this.cursor=s,this.value=this.choices[s].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){thi | ... truncated

EPERM: Operation not permitted
errno: -1
syscall: "write"
fd: 12

at write (native:1:1)
at NativeWritablePrototypeWrite (node:stream:3671:38)
at render (/tmp/bunx-1000-create-vite@latest/node_modules/create-vite/dist/index.mjs:7:61)
at new i (/tmp/bunx-1000-create-vite@latest/node_modules/create-vite/dist/index.mjs:1:56)
at /tmp/bunx-1000-create-vite@latest/node_modules/create-vite/dist/index.mjs:1:946
at new Promise (native:1:11)
at l (/tmp/bunx-1000-create-vite@latest/node_modules/create-vite/dist/index.mjs:1:946)
at /tmp/bunx-1000-create-vite@latest/node_modules/create-vite/dist/index.mjs:1:946
at t (/tmp/bunx-1000-create-vite@latest/node_modules/create-vite/dist/index.mjs:1:946)
at /tmp/bunx-1000-create-vite@latest/node_modules/create-vite/dist/index.mjs:1:1400

Bun v1.1.34 (Linux x64)

AND

$ bun create react-app resume_js

Creating a new React app in /home/gaurav/node_projects/resume_js.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...


Aborting installation.
Unexpected error. Please report it as a bug:
7 | function spawn(command, args, options) {
8 |     // Parse the arguments
9 |     const parsed = parse(command, args, options);
10 |
11 |     // Spawn the child process
12 |     const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
^
TypeError: Executable not found in $PATH: "npm"
code: "ERR_INVALID_ARG_TYPE"

at spawn (node:child_process:580:8)
at spawn (node:child_process:9:15)
at spawn (/tmp/bunx-1000-create-react-app@latest/node_modules/cross-spawn/index.js:12:24)
at /tmp/bunx-1000-create-react-app@latest/node_modules/create-react-app/createReactApp.js:383:19
at new Promise (1:11)
at install (/tmp/bunx-1000-create-react-app@latest/node_modules/create-react-app/createReactApp.js:334:10)
at /tmp/bunx-1000-create-react-app@latest/node_modules/create-react-app/createReactApp.js:461:16


Deleting generated file... package.json
Deleting resume_js/ from /home/gaurav/node_projects
Done.

Additional information

even bun upgrade command is not working.

$ bun upgrade
Bun v1.1.36 is out! You're on v1.1.34
error: Failed to locate "unzip" in PATH. bun upgrade needs "unzip" to work.
@Gamusadev Gamusadev added bug Something isn't working needs triage labels Nov 23, 2024
@RiskyMH RiskyMH added needs investigate Needs to be investigated to find the root cause and removed needs triage labels Nov 24, 2024
@RiskyMH
Copy link
Contributor

RiskyMH commented Nov 24, 2024

  1. The first issue seems related to an incompatibility between Bun and the prompts library on your operating system, though the exact root cause isn't clear.
  2. The second issue likely occurs because create-react-app is attempting to use npm, which isn't installed on your system.
  3. The error with bun upgrade happens because the unzip package is missing and is required to install bun. You can resolve this by running: sudo apt install unzip

@Gamusadev, could you try installing both node and unzip to see if these issues persist? It would help determine if the prompts library works better under node1.

Footnotes

  1. note that once you install node, you will have to bun --bun create vite to make bunx use bun runtime. learn more here. (normal running files like bun run index.ts will always use bun runtime.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigate Needs to be investigated to find the root cause
Projects
None yet
Development

No branches or pull requests

2 participants