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

package.json postinstall not working on Windows msysgit #28

Open
kayhadrin opened this issue Mar 25, 2014 · 3 comments · May be fixed by #38
Open

package.json postinstall not working on Windows msysgit #28

kayhadrin opened this issue Mar 25, 2014 · 3 comments · May be fixed by #38

Comments

@kayhadrin
Copy link

Note that the postinstall command does not work on msysgit on Windows.

In package.json:

"scripts": {
    "postinstall": "./node_modules/.bin/bower install"
}

I get this error during the npm install.

> [email protected] postinstall c:\workspace\AngularJS-Testing-Article
> ./node_modules/.bin/bower install

'.' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! [email protected] postinstall: `./node_modules/.bin/bower install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the yom-angularjs-testing-article package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./node_modules/.bin/bower install
npm ERR! You can get their info via:
npm ERR!     npm owner ls yom-angularjs-testing-article
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\\dev\\apps\\nodejs\\node.exe" "c:\\dev\\apps\\nodejs\\node_modules\\npm\\bin\\npm-cli.js"
 "install"
npm ERR! cwd c:\itrac\workspace\AngularJS-Testing-Article
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     c:\workspace\AngularJS-Testing-Article\npm-debug.log
npm ERR! not ok code 0

This is because on Windows, the postinstall command is executed as a "DOS" command instead.

Perhaps it'd be good to add a mention of this in the readme file?

@foxhard
Copy link

foxhard commented Oct 1, 2014

Hi,

How do you have fixed that? because I think I have the same problem (See the error image: http://snag.gy/gtRlU.jpg).

Regards,
Cristhiam

@kayhadrin
Copy link
Author

@foxhard You can fix this like in this PR #38.

@kayhadrin kayhadrin linked a pull request Oct 2, 2014 that will close this issue
@foxhard
Copy link

foxhard commented Oct 2, 2014

Hi,

I have make those changes on package.json, but now I have a new errors. Maybe my package.json is all bad. Here you can get my package.json

This is the result in git bash console after execute "npm install"

Stack trace:
TypeError: Arguments to path.join must be strings
at f (path.js:204:15)
at Object.filter (native)
at Object.exports.join (path.js:209:40)
at GitHubResolver.GitResolver._cleanup (c:\AngularJS-Testing-Article\node_modules\bower\lib\core\resolvers\GitResolver.js:185:26)
at c:\AngularJS-Testing-Article\node_modules\bower\lib\core\resolvers\GitResolver.js:74:25
at Promise.apply (c:\AngularJS-Testing-Article\node_modules\bower\node_modules\q\q.js:1122:26)
at Promise.promise.promiseDispatch (c:\AngularJS-Testing-Article\node_modules\bower\node_modules\q\q.js:752:41)
at c:\AngularJS-Testing-Article\node_modules\bower\node_modules\q\q.js:1337:14
at flush (c:\AngularJS-Testing-Article\node_modules\bower\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)

Console trace:
Trace at StandardRenderer.error (c:\AngularJS-Testing-Article\node_modules\bower\lib\renderers\StandardRenderer.js:74:17)
at Logger.updateNotifier.packageName (c:\AngularJS-Testing-Article\node_modules\bower\bin\bower:109:18)
at Logger.emit (events.js:95:17)
at Logger.emit (c:\AngularJS-Testing-Article\node_modules\bower\node_modules\bower-logger\lib\Logger.js:29:39)
at c:\AngularJS-Testing-Article\node_modules\bower\lib\commands\install.js:27:16
at _rejected (c:\AngularJS-Testing-Article\node_modules\bower\node_modules\q\q.js:808:24)
at c:\AngularJS-Testing-Article\node_modules\bower\node_modules\q\q.js:834:30
at Promise.when (c:\AngularJS-Testing-Article\node_modules\bower\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (c:\AngularJS-Testing-Article\node_modules\bower\node_modules\q\q.js:752:41)
at c:\AngularJS-Testing-Article\node_modules\bower\node_modules\q\q.js:574:44

System info:
Bower version: 1.2.8
Node version: 0.10.32
OS: Windows_NT 6.1.7601 x64

npm ERR! [email protected] postinstall: node node_modules/bower/bin/bower install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the yom-angularjs-testing-article package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node node_modules/bower/bin/bower install
npm ERR! You can get their info via:
npm ERR! npm owner ls yom-angularjs-testing-article
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\Program Files\nodejs\node.exe" "c:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd c:\AngularJS-Testing-Article
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! c:\AngularJS-Testing-Article\npm-debug.log
npm ERR! not ok code 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants