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

install should use -g #1

Closed
adrinux opened this issue Nov 28, 2012 · 4 comments
Closed

install should use -g #1

adrinux opened this issue Nov 28, 2012 · 4 comments

Comments

@adrinux
Copy link

adrinux commented Nov 28, 2012

The install fails with errors trying to install into the current directory unless -g is used.

npm install -g punch-sass-compiler

Though this would depend whether you installed punch or node with -g I presume.

I'm both a node, npm and punch noob. So perhaps it's assumed that you need to add the -g flag?

@laktek
Copy link
Owner

laktek commented Nov 28, 2012

Hmm..I tried installing the plugin locally in a setup where punch is installed globally (with -g). It does seem to install without an issue.

Can you share the error you get?

@adrinux
Copy link
Author

adrinux commented Dec 7, 2012

Do you have the plugins globally installed also? Now that I do they install locally without errors. I'm pulling an older copy of my VM out of Time machine backup to see if I can recreate the errors.

Having learnt a bit more about npm over the last few days I now realise part of the problem stemmed from my confusion over local vs globally installed modules.

As a lone developer expecting to export only the static output to my production server global makes more sense than having plugins installed in every site. But I can see that for certain more dynamic uses – like punch blog, or if you expect to transfer ownership, or share development with other devs – that local install of plugins would make sense.

I'll post the errors I got if I can recreate them, but they ended up happening for all the punch plugins I installed not just this one, and are most likely to do with dependencies. Since that's all to do with npm local vs global and mixing those up its probably out of scope for this project to fix. Adding some discussion of local/global to the docs or linking to npm faq about this issue should help node.js noobs like me though.

@laktek
Copy link
Owner

laktek commented Dec 7, 2012

Thanks for the sharing your experience on this. I agree on the fact that we should improve the documentation on the plugins to include the npm conventions. I'll work on that.

Share the error you get, if you experience any issues with Sass or any other punch based plugins.

@adrinux
Copy link
Author

adrinux commented Dec 7, 2012

Details of what I did

OS: Ubuntu 12.04.1 LTS
node and npm packages installed with chris-lea ppa:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm

The above had been done already in the VM I restored from backup.

Install punch globally

sudo npm install -g punch

Create a punch site, attempt to install a plugin as per docs (locally that is):

punch setup /var/www/nfs/ssg/plugin-test
cd /var/www/nfs/ssg/plugin-test
npm install punch-sass-compiler
npm install punch-sftp-publisher

And everything works perfectly. sigh
At this point I have no idea why it didn't work before, really should have saved the error at the time (there were several screens of it).

Will close this and add a more general issue about documentation of local/global.

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