-
Notifications
You must be signed in to change notification settings - Fork 48
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
SPFx:1.11.0 - Run docker for an existing project - Permission Denied #65
Comments
Have you tried removing node_modules (or move it somewhere for the backup) and trying to run |
I've tried that before. After deleting the folder node_modules and then the
directory not empty, rmdir '/usr/app/spfx/node_modules/.staging/typescript-950cdf73/lib/fr' Now I'm still trying to delete the node_modules folder again and run |
Do I get it correctly:
Is that about right? |
I just got a similar error with another folder / library:
I also noticed that node_modules is created, packages are loaded and extracted. |
Could be that permissions of the project directory on your host computer does not include "Write" for "Users" group? |
Permissions of the project directory on your host computer does not include "Write" for "Users" group? So I still had to add -p 5432: 5432 to the docker run port Unfortunately, I have now tried it on my second VM on git/project folder and here again the same problem:
I will try to add permissions to the root folder and possibly restart the OS ... it behaves quite randomly, but there will probably be some formula in it. |
Yes, we removed this port parameter because SPFx v.1.13.0 does not include workbench. I guess we might want to return it back to readme where we describe known issues... |
This is a good point @shurick81: since there are older versions that do support local workbench, we should consider extending the guidance to accommodate different versions. |
Unfortunately, I have to reopen this issue, So if I run:
but if I create a folder: I'm already desperate, maybe I'm doing something wrong, but I thought the whole development might work as follows, correct me if I'm wrong:
Docker folder sharing settings Is it possible that git somehow locks files? |
Should we try together with the same repo, https://github.com/shurick81/spfx1110testwp00. git clone https://github.com/shurick81/spfx1110testwp00
cd C:\git\spfx1110testwp00\helloworld
docker run --rm -v ${pwd}:/usr/app/spfx waldekm/spfx:1.11.0 npm install This one worked just fine for me. I just created it via this command:
And don't forget to check that C:\git\spfx1110testwp00\helloworld permissions allow editing to the built in "Users" group. |
This went good at first, I didn't even have to set permissions for anything (folder or docker) ... interesting, right? |
so when you clone https://github.com/shurick81/spfx1110testwp00 git repo, fix the permissions and then run npm install in docker, it does not work? |
Only what i did was that i created a new folder - after i used git clone - after npm install and everything works (without any additional permisson). |
@necik11, I don't get what were your actions last time, sorry.
Could you specify the sequence how it works for you? |
|
I still don't get every detail but let me ask you this way then. The difference between cases when it works and does not work boils down to different git code or does it boil down to different steps (folder location, folder creation, permissions setting, etc.) |
What you mean by "I created on c: folder github."? Do I get it right that c:\git is a root folder for many different git projects on your drive? |
Yes, main problem is in folder location.
cd git
cd ProjectA
also hidden folder (.git)
cd moduleA
cd github (your repo) cd spfx1110testwp00
cd helloworld
|
Ok, so if I get it right, your experience can be described like this.
If so, please make sure that on c:\git, Users group not only has write permissions on the folder level, but also "subfolders and files": |
This particular screenshot with npm errors, is it taken from installing for your work repository? Could you take a screen of this when you clone https://github.com/shurick81/spfx1110testwp00 to git folder and then run npm install in docker? |
It's hard to describe the error, but after running the Docker Desktop on host, everything works. Probably the success is about The problem only arises when I try it on a Windows Server (VMware), where I received an error despite all the settings and permissions. It is interesting that sometimes I succeeded and it worked and the next day (after restarting the server) it did not work again ... I tried this the same thing and my colleague and it behaved exactly the same. I will try to describe the exact procedure, I apologize in advance if the information would converge, but it is difficult to describe:
The only one where the bug is probably somewhere is sharing permissions between the docker and the Windows server (VMware). Unfortunately, I no longer have time to test why this is the case, and I will develop on the desktop ... So workaround: I need to switch host virtualization vs. VMware. |
I have some questions about how to run docker for spfx.
Some time ago I started a project in version SPFx 1.11.0.
I've heard of docker before, but I thought it was unnecessary, currently, I would like to develop other things, but already in the new version SPFx 1.13.1 (for the currentity of libraries, controls, etc.).
First I tried to download an existing image from:
hub.docker.com/r/waldekm/spfx/tags
Command:
docker pull waldekm / spfx: 1.11.0
a Use command:
docker run -it --rm --name spfx-helloworld -v $ {PWD}: / usr / app / spfx -p 4321: 4321 -p 35729: 35729 waldekm / spfx
There was no problem when i was trying to create a new project.
The problem occurred when
gulp serve
an existing folder / project:C:\git\SPFx_OldWebpart
The problem is probably that npm install was done against / OS = Windows, while containerization is in Linux.
Procedure for attempting commissioning:
docker run -it --rm --name spfx-helloworld -v $ {PWD}: / usr / app / spfx -p 4321: 4321 -p 35729: 35729 waldekm / spfx: 1.11.0
spfx @ 98ecd3553a8d: /usr/app/spfx $ gulp serve
Error: Missing binding /usr/app/spfx/node_modules/node-sass/vendor/linux-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
Found bindings for the following environments:
This usually happens because your environment has changed since running
npm install
.Run
npm rebuild node-sass
to download the binding for your current environment.Npm install
:Error: EPERM: operation not permitted, unlink '/usr/app/spfx/node_modules/@pnp/common/collections.d.ts.map'
Npm rebuild node-sass
:spfx @ d0eab30de69a: / usr / app / spfx $ npm rebuild node-sass
npm ERR! Error: EPERM: operation not permitted, unlink '/usr/app/spfx/node_modules/.bin/node-sass'
Docker -> Resources -> File sharing - folder added -> permissions work because I couldn't create a new project before, but after restarting OS + docker, I could create atleast new project.
I found a similar error here (not spfx, but a general problem):
sass/node-sass#2165
You still need to do this:
sass/node-sass#2165 (comment)
??
Or I found another solution here:
https://stackoverflow.com/questions/37986800/node-sass-couldnt-find-a-binding-for-your-current-environment
https://stackoverflow.com/questions/39293636/npm-err-error-eperm-operation-not-permitted-rename
I don't know which way to go, every solution will lead me to other mistakes.
I also tried to create my own build:
from address:
https://github.com/waldekmastykarz/docker-spfx/blob/master/Dockerfile
Download DockerFile and edit it to fit the version:
Adding the line
chown -R spfx: spfx / usr / app / spfx
I found here (though for a different version):docker-spfx/issues/19
and again leads to the same mistakes ...
Or am I completely out and doing something stupid?
In what environment am I trying to run the docker:
Docker:
Or is there a mistake in this:
I use VMware Workstation 16 Player
I currently have the latest version of docker:
Docker Desktop 4.3.2 (72729) is currently the newest version available.
OS Windows Server 2019.
The text was updated successfully, but these errors were encountered: