Skip to content

Instantly share code, notes, and snippets.

@kittolau
Last active October 16, 2015 09:32
Show Gist options
  • Save kittolau/91e36524488bf0998529 to your computer and use it in GitHub Desktop.
Save kittolau/91e36524488bf0998529 to your computer and use it in GitHub Desktop.
nvm related stuff
#install from package.json
npm install
#for vagrant
#npm install --no-bin-links
#install package
npm install --save <package_name>
ref: http://stackoverflow.com/questions/21648068/what-permissions-do-i-need-to-install-bower-on-vagrant-on-windows
Self answering as I couldn't find a solution anywhere else on StackOverflow
I eventually got it to work via changing to the root user via su root and trying to install globally again. Apparently just using sudo wasn't enough.
So it became
root@precise32: npm install -g bower --no-bin-links
EDIT: As well as this solution please note the file directory + file size limitation when using Windows (260 characters I believe)
I have had to init a vagrant instance in a folder directly on my c:/ drive to get over this limitation as some packages end up having nested dependencies causing this limit to be exceeded. My problem was with grunt-contrib-less
EDIT 2: After coming across this problem again and again I'll add a bit more information for people here regarding node modules and vagrant under Windows.
I now overcome the file path limitation via putting any long dependency chains that fail due to path length (usually EPERM) I add one of the packages in the chain to my own package.json. This means the long requirement chain is split as npm does not re-install the package deeper in the tree if it's already installed.
Just make sure you require a version which is valid for the version string for the module.
The order of the dependencies in package.json does not matter, dependencies are resolved before anything is installed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment