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

How to install this plugin globally? #1

Open
aslak01 opened this issue Sep 6, 2023 · 3 comments
Open

How to install this plugin globally? #1

aslak01 opened this issue Sep 6, 2023 · 3 comments

Comments

@aslak01
Copy link

aslak01 commented Sep 6, 2023

I get this error:
Error: Cannot find module 'svgo-autocrop'

I'm trying to use this plugin but the config with the require("svgo-autocrop") doesn't seem to be able to find it even tho I have installed it globally with npm.

npm ls -g --depth 0:

/Users/me/n/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
@aslak01
Copy link
Author

aslak01 commented Sep 6, 2023

(I edited issue title from the node error message mentioned in OP when making this comment)

I understand now that it is not possible to import the code from a global npm install, but that leaves the question open: How can I add a plugin like this to my global svgo config file in my .config folder. Installing this script in a particular folder and running that with the config works but I would like it to be available globally so I don't have to worry about my current working directory when doing my optimise svg command.

@aslak01 aslak01 changed the title Error: Cannot find module 'svgo-autocrop' How to install this plugin globally? Sep 6, 2023
@itavero
Copy link

itavero commented Feb 7, 2024

Did you ever figure out how to do this?

@aslak01
Copy link
Author

aslak01 commented Feb 13, 2024

No, I found some other tools to do what I need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants