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

Win "file path too long" error #489

Closed
tomByrer opened this issue Oct 20, 2014 · 8 comments
Closed

Win "file path too long" error #489

tomByrer opened this issue Oct 20, 2014 · 8 comments

Comments

@tomByrer
Copy link

Well, ye olde NPM won't work on Windows because too many nested deps bug came up for me.
I had a bunch of errors after install, but I thought they might be because I was using a Node fork, JXCore. But I found node-sass 1.0.1 is having build issues also (may or may not be related). Since I didn't save my error log (which was long) I was going to npm install with a fresh install of stable Node 32bit for Windows. But deleting the entire /node_modules I got this error:
npm-web-starter-kit_toolong
My root filepath is only 31 characters long; I made parent folder name short just to avoid this bug.

Honestly, I'm reconsidering if NPM is ready for prime-time tooling, at least in WIndows. Between this multi-year bug & versioning of the dep chain causes alot of frustration.

@kevva
Copy link

kevva commented Oct 20, 2014

Windows explorer doesn't support long file paths. Run rmdir /S /Q node_modules or use something like trash instead.

@tomByrer
Copy link
Author

Thanks @kevva

But there were other npm install issues, which there is a good chance of the cascading deps from gulp-imagemin.
I can test later after I get work done; leaving open for now.

@u01jmg3
Copy link

u01jmg3 commented Oct 20, 2014

@tomByrer - did you see the closed issues sindresorhus/gulp-imagemin#56 and gulpjs/gulp#630 (comment) which are related to "file path too long"?

trash seems to suffer from the same problem of filenames being too long for the OS (Windows) to cope with

@tomByrer
Copy link
Author

Thanks for the links @u01jmg3! Yep it was gulp-imagemin. Yep tried sindresorhus's suggestion to install Ubuntu a month ago, but they have problems fixing bugs also. Nope, don't care enough to do extra work to shoehorn something that was supposed to save time.

@sindresorhus
Copy link
Contributor

Yup, trash doesn't support long paths: sindresorhus/trash#16

You can use the rimraf CLI though: https://github.com/isaacs/rimraf

But this is not an issue with WSK. It's an issue with Windows.

@tomByrer
Copy link
Author

It's an issue with Windows.

Sorry, but incompatibility with a popular OS IS a bug. Granted, 95% of the dev shops I've been in here in Denver are 100% Macs (Craftsy, Inspirato, Pivotal Labs, Rally Software, Cloud Elements, etc). However, I'm sure you'd want devs world wide to consume this, not just privileged rich devs ;)
If this bug affected Mac users, I'm sure you'd be singing a different tune.

@u01jmg3
Copy link

u01jmg3 commented Oct 22, 2014

rimraf seems to do a decent job of deleting folders that Windows cannot handle deleting

Seem to get this error (although everything in the folder is removed) which I know is one for raising with isaacs if at all

C:\Program Files\WAMP\www>rimraf test

fs.js:617
  return binding.rmdir(pathModule._makeLong(path));
                 ^
Error: ENOTEMPTY, directory not empty 'C:\Program Files\WAMP\www\test'
    at Object.fs.rmdirSync (fs.js:617:18)
    at rmkidsSync (C:\Users\<username>\AppData\Roaming\npm\node_modules\rimraf\rimra
f.js:247:11)
    at rmdirSync (C:\Users\<username>\AppData\Roaming\npm\node_modules\rimraf\rimraf
.js:237:7)
    at fixWinEPERMSync (C:\Users\<username>\AppData\Roaming\npm\node_modules\rimraf\
rimraf.js:150:5)
    at Function.rimrafSync [as sync] (C:\Users\<username>\AppData\Roaming\npm\node_m
odules\rimraf\rimraf.js:216:26)
    at C:\Users\<username>\AppData\Roaming\npm\node_modules\rimraf\bin.js:31:12
    at Array.forEach (native)
    at Object.<anonymous> (C:\Users\<username>\AppData\Roaming\npm\node_modules\rimr
af\bin.js:30:8)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

@sindresorhus
Copy link
Contributor

Sorry, but incompatibility with a popular OS IS a bug

Agreed, it's just not our bug. npm is working on fixing it, but won't be in the short run. There's nothing we can do about this.

Use something broken and don't be surprised when you get a broken experience. IE6 comes to mind.

not just privileged rich devs ;)

Ubuntu is free. Windows is not.

There are lots of third-party tools available that let you deal with long paths.

@google google locked and limited conversation to collaborators Oct 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants