ashmind / SharpLab

.NET language playground
https://sharplab.io
BSD 2-Clause "Simplified" License
2.69k stars 197 forks source link

access denied errors when building locally #1221

Open adrianoc opened 1 year ago

adrianoc commented 1 year ago

Trying to build on Ubuntu 22.04, dotnet 6.0, I get the error below (access denied):

Installing azurite (global)
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@azure/msal-node@1.14.2',
npm WARN EBADENGINE   required: { node: '10 || 12 || 14 || 16 || 18' },
npm WARN EBADENGINE   current: { node: 'v19.0.0', npm: '8.19.2' }
npm WARN EBADENGINE }
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/azurite
npm ERR! dest /usr/local/lib/node_modules/.azurite-leaMzRkA
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/azurite' -> '/usr/local/lib/node_modules/.azurite-leaMzRkA'
npm ERR!  [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/azurite' -> '/usr/local/lib/node_modules/.azurite-leaMzRkA'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'rename',
npm ERR!   path: '/usr/local/lib/node_modules/azurite',
npm ERR!   dest: '/usr/local/lib/node_modules/.azurite-leaMzRkA'
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/adriano/.npm/_logs/2022-11-03T12_36_19_489Z-debug-0.log
Exception: /home/adriano/Projects/study/DotNet/SharpLab/#scripts/setup.ps1:28

if I launch pwsh with sudo I get a different access denied error:

npm ERR! path /home/adriano/Projects/study/DotNet/SharpLab/source/WebApp/node_modules/playwright
npm ERR! command failed
npm ERR! command sh -c -- node install.js
npm ERR! node:internal/process/promises:289
npm ERR!             triggerUncaughtException(err, true /* fromPromise */);
npm ERR!             ^
npm ERR! 
npm ERR! [Error: EACCES: permission denied, mkdir '/root/.cache/ms-playwright'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/root/.cache/ms-playwright'
npm ERR! }
npm ERR! 
npm ERR! Node.js v19.0.0

Any idea how to fix this?

ashmind commented 1 year ago

Thanks for reporting! I haven't tried developing SharpLab on Linux yet, so I can't say I am up to date on the issues. There are definitely some parts that will not work on Linux, for example the Run mode.

Most other parts should work, but need some polish. For that Playwright error, try tweaking the browser path as per https://github.com/microsoft/playwright/issues/5592#issuecomment-827794434 -- I'll need to double-check if I need local Playwright at all.

I'll take a look, but can't promise any specific timeline at the moment.

adrianoc commented 1 year ago

Hey

Just adding some context , my goal is to try to add support to specify C# language version.

Some potential ways (without thinking to much):

  1. Add it to the list of platforms / Roslyn branches, i.e, have another entry like C# Language Version and underneath, the versions from 1.0 -> Latest
  2. Get the language version through a get parameter (www.sharplab.io?langVersion=11 for instance)
  3. Add another drop down with the supported language versions

Most likely I'll make a POC based on 2 (I guess this is the easiest one) and if it proves viable we can decide if one of the other options would be a better alternative.

There are definitely some parts that will not work on Linux, for example the Run mode. Interesting. That's okeyish. Out of curiosity, why do you think it will not work on Linux? Some dependent library that only support Windows?

I'll take a look, but can't promise any specific timeline at the moment. np at all.

Getting back is already very respectful from you :)

When I find some time I'll try to follow the suggestions from MS.