-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
EACCESS: permission denied #523
Comments
I should note that this is with version 1.2.0. |
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue. |
@gavanfantom thanks for the issue. Just to get some more information are you saying this worked in the previous version? |
@gavanfantom yes, please specify if the previous version has the same effect for you. From debug I can see that all looks good on the generator side, and looks like the app just doesn't have the right to do any changes in |
@derberg just a side question does the generator actually check the global |
I have the same problem with version 1.1.11. |
Yeap, this use case never worked and won't work with the latest version we released today. We use https://github.com/sindresorhus/resolve-pkg to resolve dependencies, and we look as @jonaslagoni wrote, into this is why you are getting
but then we try to install it again, into did you try installing generator with |
I have just tried reinstalling with: sudo npm -g install @asyncapi/generator --unsafe-perm=true --allow-root (you did mean @asyncapi/generator rather than generator, right?) I'm still getting the same error. |
yeap, sorry, thinking with shortcuts 😄 can you try doing |
I was getting some issues when using generator version >=1.2.0. I used yarn but was able to contain the issue using npm with Docker. I simplified this as much I could. Using Node 14: FROM ubuntu:20.04
RUN apt-get update \
&& apt-get -y install curl git
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash \
&& apt-get update \
&& apt-get -y install nodejs
# Install generator
RUN npm install --global --unsafe-perm=true --allow-root @asyncapi/generator@1.1.11
# Generate with dummy yaml
RUN echo "asyncapi: 2.0.0\ninfo:\n title: dummy\n version: 0.0.0\nchannels: {}" > dummy.yaml \
&& mkdir html \
&& ag --debug dummy.yaml @asyncapi/html-template -o html This works and generates fine. However if generator version is changed to 1.2.0 or newer this will fail:
Hopefully this helps |
drwxr-xr-x 6 root root 4096 Mar 3 12:37 /usr/local/lib/node_modules/ It does have write permission, but only for root. Allowing non-root users write access to this directory can not possibly be the right answer. I'm also a bit confused as to why "this use case never worked and won't work with the latest version we released today." This use case is literally the one documented in README.md ("Install the CLI"). Is there a different installation method that I should be using? |
Yea I agree with you here, @gavanfantom what would you like to see it changed to (in case we don't install templates where the generator is installed)? |
I'm not sure what is your expectation here towards the generator
I guess I didn't make myself clear, sorry. I meant that |
I'm not really sure what the ideal solution would be. I would have thought though, that something like the following should work:
|
let us then first make sure we support globally installed templates too. Once this works, let us reiterate again to see what else could be done on the generator side.
I'll make sure to extend logs as much as possible when I will work on enabling global templates support.
if you use CLI it will install under user local where the generator is installed globally. Otherwise, it will install in the project where you use the generator as a library |
PR is opened #530 |
🎉 This issue has been resolved in version 1.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Unfortunately this doesn't entirely resolve the issue, as even with the new version we still get: $ ag --debug api_description.yml @asyncapi/html-template This is with @asyncapi/html-template installed globally. |
If the template is installed globally, it should not log |
Not to worry, it turns out that somehow an old version had got installed that npm didn't replace with the latest. I have manually cleaned up after npm, and reinstalled, and it works much better now. |
Awesome 🚀 |
I'm receiving this error when trying to use the Is this expected? docker run --rm -it -v asyncapi.json:/app/asyncapi.json -v output:/app/output asynca
pi/cli generate fromTemplate -o output asyncapi.json @asyncapi/html-template
Generation in progress. Keep calm and wait a bit... done
Generator Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/node-fetch/node_modules' |
Adding this fixed it for me: --user=root |
Describe the bug
Running a simple ag command fails with a permission error
How to Reproduce
Expected behavior
I expected ag to generate some nice pretty HTML, not try to install files in a system location. I expected ag to find the previously installed template. I also expected that if ag did need to download anything, it would not do so into a place that needed root privileges.
The text was updated successfully, but these errors were encountered: