borodean / postcss-assets

An asset manager for PostCSS
MIT License
537 stars 32 forks source link

Fails to install via npm on Windows #30

Closed benfrain closed 8 years ago

benfrain commented 9 years ago

No problem installing this plugin on my Mac system but when a fellow dev tries to install on a Windows 7 machine it fails to load. I believe it's to do with the way the path is specified to image-size: https://github.com/borodean/postcss-assets/blob/develop/package.json#L21

Is it possible change this to a full git url? Haven't done a PR for this incase there is a specific reason you don't want it that way.

borodean commented 9 years ago

@benfrain the reason is that the original image-size has glitchy SVG size calculation and on my private fork it was fixed. No PRs for image-size are getting merged, so I guess that the image-size was forbidden and we probably have to come up with another solution.

I'll study it this weekend and I'll try to see what can be done.

benfrain commented 9 years ago

Thanks. appreciated :+1:

borodean commented 9 years ago

@benfrain I've just tried it on my Windows 10 machine with NodeJS v4.1.1 and git installed and it worked. Could you please share what particular environment do you have?

benfrain commented 9 years ago

I'm on Windows 7, with node v0.12.7

I've tried this a few ways. npm install postcss-assets --save-dev produces this:

npm install postcss-assets --save-dev npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url npm WARN addRemoteGit npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:751:12) npm WARN addRemoteGit at ChildProcess.emit (events.js:110:17) npm WARN addRemoteGit at maybeClose (child_process.js:1015:16) npm WARN addRemoteGit at Socket. (child_process.js:1183:11) npm WARN addRemoteGit at Socket.emit (events.js:107:17) npm WARN addRemoteGit at Pipe.close (net.js:485:12) npm WARN addRemoteGit borodean/image-size resetting remote C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size-git-12731099 because of error: { [Error: Command failed: git -c core.longpaths=true con ig --get remote.origin.url npm WARN addRemoteGit ] npm WARN addRemoteGit killed: false, npm WARN addRemoteGit code: 1, npm WARN addRemoteGit signal: null, npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' } npm ERR! git clone --template=C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes_templates --mirror git://github.com/borodean/image-size.git C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size git-12731099: Cloning into bare repository 'C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size-git-12731099'... npm ERR! git clone --template=C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes_templates --mirror git://github.com/borodean/image-size.git C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size git-12731099: fatal: unable to connect to github.com: npm ERR! git clone --template=C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes_templates --mirror git://github.com/borodean/image-size.git C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size git-12731099: github.com[0: 192.30.252.131]: errno=No error postcss-assets@3.0.2 node_modules\postcss-assets ├── canonical-path@0.0.2 ├── cssesc@0.1.0 ├── mime@1.3.4 ├── image-size@0.3.5 ├── directory-encoder@0.7.2 (img-stats@0.5.2, fs-extra@0.23.1, handlebars@1.3.0) └── gonzales@1.0.7

If I run:

npm install postcss-assets --save-dev --save-exact

I get this:

npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config - -get remote.origin.url npm WARN addRemoteGit npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:751:12) npm WARN addRemoteGit at ChildProcess.emit (events.js:110:17) npm WARN addRemoteGit at maybeClose (child_process.js:1015:16) npm WARN addRemoteGit at Socket. (child_process.js:1183:11) npm WARN addRemoteGit at Socket.emit (events.js:107:17) npm WARN addRemoteGit at Pipe.close (net.js:485:12) npm WARN addRemoteGit borodean/image-size resetting remote C:\Users\benfrain\Ap pData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size-git-1273 1099 because of error: { [Error: Command failed: git -c core.longpaths=true conf ig --get remote.origin.url npm WARN addRemoteGit ] npm WARN addRemoteGit killed: false, npm WARN addRemoteGit code: 1, npm WARN addRemoteGit signal: null, npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.ori gin.url' } npm ERR! git clone --template=C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes_templates --mirror git://github.com/borodean/image-size.git C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size-git-12731099: Cloning into bare repository 'C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size-git-12731099'... npm ERR! git clone --template=C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes_templates --mirror git://github.com/borodean/image-size.git C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size-git-12731099: fatal: unable to connect to github.com: npm ERR! git clone --template=C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes_templates --mirror git://github.com/borodean/image-size.git C:\Users\benfrain\AppData\Roaming\npm-cache_git-remotes\git-github-com-borodean-image-size-git-12731099: github.com[0: 192.30.252.131]: errno=No error postcss-assets@3.0.2 node_modules\postcss-assets ├── canonical-path@0.0.2 ├── cssesc@0.1.0 ├── mime@1.3.4 ├── image-size@0.3.5 ├── directory-encoder@0.7.2 (img-stats@0.5.2, fs-extra@0.23.1, handlebars@1.3.0) └── gonzales@1.0.7

I had wondered if it might be some firewall issue where I am but the same thing installs fine on OS X.

borodean commented 9 years ago

@benfrain Can you try applying this patch https://github.com/borodean/postcss-assets/commit/2db229acf13708b9d9073a5486fe562cefb2a0e1?

benfrain commented 9 years ago

Sorry for delay. Will do tomorrow

On 30 Sep 2015, at 23:26, Vadym Borodin notifications@github.com wrote:

@benfrain Can you try applying this patch 2db229a?

— Reply to this email directly or view it on GitHub.

borodean commented 9 years ago

@benfrain sorry, I've just realized that I've explained nothing on how to test this patch :smile:

So, I suggest cloning the patched branch to a new directory and then trying to npm install from it. If it goes fine, the issue should be resolved and I'll draft a release.

borodean commented 9 years ago

@benfrain any updates?

benfrain commented 9 years ago

OK, not sure if this is what you intended. I created a folder 'test-postcss-assets' in the root of my project. From there I ran git clone https://github.com/borodean/postcss-assets.git . then updated my package.json to include this:

"postcss-assets": "./test-postcss-assets",

When I then do an npm install I get this:

npm install
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config -
-get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:751:12)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:110:17)
npm WARN addRemoteGit     at maybeClose (child_process.js:1015:16)
npm WARN addRemoteGit     at Process.ChildProcess._handle.onexit (child_process.
js:1087:5)
npm WARN addRemoteGit  borodean/image-size resetting remote C:\Users\benfrain\Ap
pData\Roaming\npm-cache\_git-remotes\git-github-com-borodean-image-size-git-1273
1099 because of error: { [Error: Command failed: git -c core.longpaths=true conf
ig --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.ori
gin.url' }
npm ERR! git clone --template=C:\Users\benfrain\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/borodean/image-size.git C:\Users\benfrain\AppData\Roaming\npm-cache\_git-remotes\git-github-com-borodean-image-size-git-12731099: Cloning into bare repository 'C:\Users\benfrain\AppData\Roaming\npm-cache\_git-remotes\git-github-com-borodean-image-size-git-12731099'...
npm ERR! git clone --template=C:\Users\benfrain\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/borodean/image-size.git C:\Users\benfrain\AppData\Roaming\npm-cache\_git-remotes\git-github-com-borodean-image-size-git-12731099: fatal: unable to connect to github.com:
npm ERR! git clone --template=C:\Users\benfrain\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/borodean/image-size.git C:\Users\benfrain\AppData\Roaming\npm-cache\_git-remotes\git-github-com-borodean-image-size-git-12731099: github.com[0: 192.30.252.131]: errno=No error
canonical-path@0.0.2 node_modules\canonical-path

cssesc@0.1.0 node_modules\cssesc

mime@1.3.4 node_modules\mime

image-size@0.3.5 node_modules\image-size
borodean commented 8 years ago

@benfrain to solve all that mess with abandonned image-size library I'm going to migrate postcss-assets to calipers. It doesn't support SVG yet, but is actively developed so I'm going to contribute them. However, it means there would be no fix until SVG is done in calipers.

benfrain commented 8 years ago

Hi Vadym,

Sure, I appreciate your efforts. Look forward to integrating it once that’s done.

Thanks again, Ben

On 1 Nov 2015, at 22:41, Vadym Borodin <notifications@github.com mailto:notifications@github.com> wrote:

@benfrain https://github.com/benfrain to solve all that mess with abandonned image-size https://github.com/netroy/image-size library I'm going to migrate postcss-assets to calipers https://github.com/lob/calipers. It doesn't support SVG yet https://github.com/lob/calipers/issues/29, but is actively developed so I'm going to contribute them. However, it means there would be no fix until SVG is done in calipers.

— Reply to this email directly or view it on GitHub https://github.com/borodean/postcss-assets/pull/30#issuecomment-152871045.

borodean commented 8 years ago

@benfrain image-size library has updated. Could you install postcss-assets 3.0.3 and confirm the issue is gone for you?

benfrain commented 8 years ago

@borodean excellent. I'll try and test tomorrow. Thanks. :+1: