Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Error on npm install : TypeError: Arguments to path.join must be strings #186

Closed
manish0109 opened this issue Jul 11, 2014 · 12 comments
Closed

Comments

@manish0109
Copy link

Hi,

I took the latest from Git and executed npm install. I am getting following error

npm ERR! [email protected] postinstall: 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 angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get their info via:
npm ERR! npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.14-0.bpo.1-amd64
npm ERR! command "/home/ubuntu/.nvm/v0.10.28/bin/node" "/home/ubuntu/.nvm/v0.10.28/bin/npm" "install"
npm ERR! cwd /home/ubuntu/workspace
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ubuntu/workspace/npm-debug.log
npm ERR! not ok code 0

If I run "bower install" only

I get following error :-

bower #1.2.x error Arguments to path.join must be strings

Stack trace:
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at GitHubResolver._checkout (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/lib/core/resolvers/GitHubResolver.js:54:21)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/lib/core/resolvers/GitResolver.js:69:21
at _fulfilled (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:760:13)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:574:44
at flush (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:108:17)

Console trace:
Trace
at StandardRenderer.error (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/lib/renderers/StandardRenderer.js:72:17)
at Logger. (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/bin/bower:111:22)
at Logger.EventEmitter.emit (events.js:95:17)
at Logger.emit (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/lib/commands/index.js:40:20
at _rejected (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:797:24)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:823:30
at Promise.when (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:741:41)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:557:44

System info:
Bower version: 1.3.7
Node version: 0.10.28
OS: Linux 3.14-0.bpo.1-amd64 x64

I tried this on two different machines (Windows & Linux) and got the same problem.

Any idea? Why is it breaking

Thanks,
Munish

@petebacondarwin
Copy link
Contributor

Can you install and run bower directly:

npm install -g bower
bower install

It may be that your network setup is blocking the git: protocol, in which case you could try

git config --global url."https://".insteadOf git://

See https://coderwall.com/p/sitezg

@manish0109
Copy link
Author

I actually tried this. Did not changed anything.

I first tried it on my windows machine and then tried it on Cloud9 IDE.

It's the same issue at both these places.

@petebacondarwin
Copy link
Contributor

What is the output from running bower directly?

@manish0109
Copy link
Author

If I run "bower install" only

I get following error :-

bower #1.2.x error Arguments to path.join must be strings

Stack trace:
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at GitHubResolver._checkout (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/lib/core/resolvers/GitHubResolver.js:54:21)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/lib/core/resolvers/GitResolver.js:69:21
at _fulfilled (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:760:13)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:574:44
at flush (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:108:17)

Console trace:
Trace
at StandardRenderer.error (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/lib/renderers/StandardRenderer.js:72:17)
at Logger. (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/bin/bower:111:22)
at Logger.EventEmitter.emit (events.js:95:17)
at Logger.emit (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/lib/commands/index.js:40:20
at _rejected (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:797:24)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:823:30
at Promise.when (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch (/home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:741:41)
at /home/ubuntu/.nvm/v0.10.28/lib/node_modules/bower/node_modules/q/q.js:557:44

System info:
Bower version: 1.3.7
Node version: 0.10.28
OS: Linux 3.14-0.bpo.1-amd64 x64

@petebacondarwin
Copy link
Contributor

This seems like we have a problem with bower, rather than with angular-phonecat.

I just upgraded my bower installation to 1.3.7 and it also fails.

@manish0109
Copy link
Author

Thanks Pete.

Can you please tell me which version of bower you were using earlier?

I can switch to a previous version of bower and start working on the application.

@petebacondarwin
Copy link
Contributor

I am debugging it. I thought I was using 1.3.1 but this isn't working for me now either!
It is something to do with this line: https://github.com/bower/bower/blob/master/lib/core/resolvers/GitHubResolver.js#L54

@petebacondarwin
Copy link
Contributor

OK, so it looks like tmp.dir() is passing more than one non-err variable in its callback and so q.nfcall() is wrapping them into a array. See kriskowal/q#373 (comment)

bower/bower#1404

@manish0109
Copy link
Author

Yes it's a bower's issue.

Thanks a lot Pete for your help

@petebacondarwin
Copy link
Contributor

I pushed a workaround for angular-phonecat here: 3bb0fbd
Do a clean clone and try again

@manish0109
Copy link
Author

Great. It is working now

Thanks,
Munish

@petebacondarwin
Copy link
Contributor

Excellent!

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

2 participants