Modernizr / gulp-modernizr

Gulp wrapper for custom Modernizr builds
MIT License
117 stars 29 forks source link

Install failing #6

Closed sQVe closed 10 years ago

sQVe commented 10 years ago

I'm trying to install this package the following way:

npm install --save-dev git://github.com/doctyper/gulp-modernizr.git

Also by just cloning the rep and then running npm install in it.

Both ways give me this error:

> customizr@0.0.0 postinstall c:\Users\grunningO\Desktop\ghost\content\themes\laban\node_moules\customizr
> if [[ -d node_modules/modernizr ]]; then ( cd node_modules/modernizr; npm install --prodution; cd -; ); fi

Oväntat -d.

npm ERR! customizr@0.0.0 postinstall: `if [[ -d node_modules/modernizr ]]; then ( cd node_mdules/modernizr; npm install --production; cd -; ); fi`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the customizr@0.0.0 postinstall script.

I'm on Windows, if that makes any difference.

Would love some help or insight on how I could resolve this error, would really love to use your awesome customizr.

doctyper commented 10 years ago

Might be a case of the Windows environment not able to execute bash commands. I'm not currently able to test this unfortunately, but maybe you could run that command in your shell from your project root and paste the output here.

backflip commented 10 years ago

Is this bash command necessary? Why do we have to run npm install again for this dependency?

backflip commented 10 years ago

A solution would be to use a postinstall.js which runs on all platforms, same for npm test: https://github.com/backflip/customizr/commit/07a0daa744a154758660a1fa00c97fc962bc1469

backflip commented 10 years ago

@doctyper Would you consider a pull-request containing above changes?

Alex-D commented 10 years ago

Can you make a pull request @backflip? This seems like good, but I prefer keep the main repo as target.

JvanderHeide commented 10 years ago

+1 for this :+1:

blazkovicz commented 10 years ago

have same issue. System Windows_NT 6.1.7601 node 0.10.31 npm 1.4.23

Alex-D commented 10 years ago

I've make Pull Request directly from the @backflip code here : https://github.com/doctyper/customizr/pull/4

backflip commented 10 years ago

Sorry for the delay, @Alex-D.

IMHO, my fork isn't really ready for merging:

  1. It uses a fork of Modernizr (see https://github.com/Modernizr/Modernizr/pull/1380)
  2. I'm not sure whether test.js really works (I might have just created it to the point where it didn't throw an error anymore).
doctyper commented 10 years ago

I've just pushed an updated build to the develop branch. It moves the inline shell code to a (hopefully) cross-OS-friendly node script. To update:

$ npm uninstall gulp-modernizr
$ npm cache clear
$ npm install --save-dev "gulp-modernizr@https://github.com/doctyper/gulp-modernizr/tarball/develop"

Let me know if this alleviates the errors.

/ht @backflip

backflip commented 10 years ago

Thanks a lot! As mentioned in https://github.com/doctyper/gulp-modernizr/issues/14#issuecomment-61655979 there is still an issue with spawn on Windows, but https://github.com/doctyper/customizr/pull/5 should resolve it.