vmware-archive / scripted

The Scripted code editor
Eclipse Public License 1.0
1.56k stars 166 forks source link

"sudo npm install -g scripted" exits with error message "TypeError: Arguments to path.join must be strings" #281

Closed rodoherty1 closed 11 years ago

rodoherty1 commented 11 years ago

This error has been reproduced on a Ubuntu 13.04 with nodejs 0.10.4 and on Linux Mint 14.1 running node.js 0.10.9 (and 0.10.14).

On my Ubuntu 13.04 machine, I previously had scripted 0.4 running successfully but following a reinstallation of my Linux Mint 14.1 machine and the subsequent errors that I encountered when attempting to install scripted-editor, I decided to try reinstalling scripted-editor on my Ubuntu 13.04 machine. The command "sudo npm install -g scripted" exited with the following error message.

Do you think this is an error with the scripted package?

Kind Regards,

Rob.

[ws v0.4.20] Native extension compilation successful! /usr/local/bin/scr -> /usr/local/lib/node_modules/scripted/bin/scr /usr/local/bin/scripted -> /usr/local/lib/node_modules/scripted/bin/scripted

scripted@0.4.0 postinstall /usr/local/lib/node_modules/scripted cd client && bower install

/usr/local/lib/node_modules/scripted/node_modules/bower/node_modules/tmp/lib/tmp.js:260 throw err; ^ 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 Object. (/usr/local/lib/node_modules/scripted/node_modules/bower/lib/core/config.js:35:22) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) npm ERR! scripted@0.4.0 postinstall: cd client && bower install npm ERR! sh "-c" "cd client && bower install" failed with 7 npm ERR! npm ERR! Failed at the scripted@0.4.0 postinstall script. npm ERR! This is most likely a problem with the scripted package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! cd client && bower install npm ERR! You can get their info via: npm ERR! npm owner ls scripted npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.0-23-generic npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "scripted" npm ERR! cwd /home/rob/workspace/podcasts npm ERR! node -v v0.10.4 npm ERR! npm -v 1.2.18 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/rob/workspace/podcasts/npm-debug.log npm ERR! not ok code 0

kdvolder commented 11 years ago

I remember hitting a problem similar to this. Don't recall the details... but it was a problem with bower and how it uses folders when running in -g mode. There was some permission problem because trying to install stuff into global folders owned by root. Even running as 'sudo' didn't seem to work right in some cases.

I never really found a good solution to make the -g install option work nicely.

My workaround for the problem was to not install scripted globally with -g but instead just create a node_modules under under my users home dir. Then install scripted into that dir:

cd ~
mkdir node_modules
npm install scripted

This will install scripted into your ~/node_modules dir. The start scripts will be under ~/node_modules/bin. So add this bin dir to your path.

Not sure your case is the same as mine, but this is worth a try.

Kris

kdvolder commented 11 years ago

Oh I remember something else about this. The bower cache was involved as well. The problem I remember was when running via sudo it would create cached data inside your home directory that ended up being owned by root. So you may need to sudo and delete the bower cache before the above workaround will work.

kokujin commented 11 years ago

Same here. ETA when this would be looked into?

scothis commented 11 years ago

The error looks to be coming from bower. Node 0.10 added the additional assertion that args to path.join must be strings instead of being coerced to strings.

I know this is a lame response, but for now you can fall back to Node 0.8 to install scripted.

rodoherty1 commented 11 years ago

Hi Guys,

Thank you very much for your replies.

I have no problem downgrading to Node 0.8. I'll try that as soon as I have reinstalled my Linux Mint at home.

Thanks again for your help!!

Rob.

scothis commented 11 years ago

You can also install from master, which doesn't suffer from this issue.

rodoherty1 commented 11 years ago

Hmmm ... thanks for the suggestion, Scott. I did try installing scripted-editor from the master but I recall hitting the same problem.

I'll try it again but at least I have the choice of rolling back to Node 0.8.

Thanks again,

Rob.