stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.77k stars 142 forks source link

Nodemon #1104

Open XFrineX opened 1 year ago

XFrineX commented 1 year ago

Describe the bug

I can't install nodemon

Result:

`npm ERR! code EACCES npm ERR! syscall mkdir npm ERR! path /usr/local/lib/node_modules/nodemon/node_modules/chokidar npm ERR! errno -13 npm ERR! EACCES: permission denied, mkdir '/usr/local/lib/node_modules/nodemon/node_modules/chokidar' npm ERR! [EACCES: permission denied, mkdir '/usr/local/lib/node_modules/nodemon/node_modules/chokidar'] { npm ERR! code: 'EACCES', npm ERR! errno: -13, npm ERR! path: '/usr/local/lib/node_modules/nodemon/node_modules/chokidar', npm ERR! syscall: 'mkdir' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in: npm ERR! /home/.npm/_logs/2023-06-20T23_27_01_298Z-debug-0.log jsh: spawn npm EACCES`

Link to the blitz that caused the error

https://stackblitz.com/edit/stackblitz-starters-vfu1ax?description=Starter%20project%20for%20Node.js,%20a%20JavaScript%20runtime%20built%20on%20Chrome%27s%20V8%20JavaScript%20engine&file=src%2Findex.js,.env,package.json&title=node.new%20Starter

Steps to reproduce

type npm install -g nodemon

Expected behavior

install it

Parity with Local

Screenshots

No response

Platform

Browser name  = Chrome
Full version  = 114.0.0.0
Major version = 114
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 92141222,
  "usedJSHeapSize": 87029974,
  "jsHeapSizeLimit": 2024275968
}
Hash = 77657b1e

Additional context

No response

SamVerschueren commented 1 year ago

Currently we don't allow installing packages globally because of permissions. It also doesn't make a lot of sense because every time you refresh the project, the global packages are gone.

Just install nodemon as a regular package with npm install nodemon. We automatically expose all binaries from node_modules/.bin of your project, so you can just type nodemon and it should work fine.

Nonetheless, I'll create an internal ticket so we can at least support npm install -g in the future.