sindresorhus / grunt-sass

Compile Sass to CSS
MIT License
1.01k stars 209 forks source link

Cannot install under a reasonable Vagrant environment #242

Closed smitelli closed 9 years ago

smitelli commented 9 years ago

grunt-sass requires node-sass, which requires sass-graph, which requires yargs, which requires cliui, which requires right-align, which requires align-text, which requires kind-of, which requires is-buffer. When grunt-sass is installed under Vagrant on a Windows host, the innermost path on the host filesystem becomes something akin to:

C:\Users\ssmitelli\code\_REDACTED_-frontend\node_modules\grunt-sass\node_modules\node-sass\node_modules\sass-graph\node_modules\yargs\node_modules\cliui\node_modules\right-align\node_modules\align-text\node_modules\kind-of\node_modules\is-buffer

... which, in my case, is 246 characters long. The longest legal pathname on NTFS (ext4, hfs+...) is 255 characters, and this leaves only 9 characters to spare. When it comes time for is-buffer to write its package.json, boom, the pathname is too long. npm fails with a cryptic unhelpful error message, and the installation fails.

I feel my base path is reasonable. I would not expect the nested dependencies of any project to come anywhere near hitting a hard filesystem limit.

garthenweb commented 9 years ago

Try npm dedupe and/ or npm v3.x beta (that has integrated dedupe into npm install). This will flatten your modules if possible to restrict your problem. See https://docs.npmjs.com/cli/dedupe.

This is more a problem with nodes module handling or even the file system itself than with grunt-sass.