Bower - error when installing package “Arguments to path.join must be strings”

前端 未结 3 654
醉梦人生
醉梦人生 2021-02-19 07:21

I just created a node project and am trying to install jquery using bower.

bower install jquery

I get the following error:

bowe         


        
相关标签:
3条回答
  • 2021-02-19 07:50

    For me npm install -update bower was not sufficient.

    I needed to install the version by specifing it explicit:

    sudo npm install -q bower@1.3.8

    and yes, I had to run this with sudo.

    0 讨论(0)
  • 2021-02-19 07:56

    For other people who are still running into this, this did the trick for me:

    bower cache clean
    
    0 讨论(0)
  • 2021-02-19 08:09

    Fix: Clear cache and update to Bower 1.3.8.

    This is what's going on:

    The tmp package updated it's API to return a cleanup callback in addition to just the directory name. Q then squashes the two arguments to the callback into an array, while bower expected just a string for the directory name.

    This causes "TypeError: Arguments to path.join must be strings" errors to appear, seemingly non-deterministic, because various spots attempt to use the _tempDir value (now an array) to join into a path.

    semver ftw!

    0 讨论(0)
提交回复
热议问题