本文介绍了Bower-安装软件包“ path.join的参数必须是字符串”时出错。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚创建了一个节点项目,并试图使用Bower安装jquery。

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

bower install jquery

我收到以下错误:

bower jquery#*              not-cached git://github.com/jquery/jquery.git#*
bower jquery#*                 resolve git://github.com/jquery/jquery.git#*
bower jquery#*                   error Arguments to path.join must be strings

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._checkout (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\lib\core\resolvers\GitHubResolver.js:54:21)
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\lib\core\resolvers\GitResolver.js:69:21
    at _fulfilled (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:798:54)
    at self.promiseDispatch.done (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:827:30)
    at Promise.promise.promiseDispatch (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:760:13)
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:574:44
    at flush (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\p-throttler\node_modules\q\q.js:108:17)

Console trace:
Trace
    at StandardRenderer.error (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\lib\renderers\StandardRenderer.js:72:17)
    at Logger.<anonymous> (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\bin\bower:111:22)
    at Logger.emit (events.js:95:17)
    at Logger.emit (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\bower-logger\lib\Logger.js:29:39)
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\lib\commands\index.js:40:20
    at _rejected (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:797:24)
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:823:30
    at Promise.when (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:1035:31)
    at Promise.promise.promiseDispatch (C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:741:41)
    at C:\Users\Adam\AppData\Roaming\npm\node_modules\bower\node_modules\q\q.js:557:44

System info:
Bower version: 1.3.7
Node version: 0.10.29
OS: Windows_NT 6.2.9200 x64

我尝试安装其他软件包,它们失败并显示相同的错误。据我所知,我有一个漂亮的香草设置。运行Windows 8.1 x64。似乎无法找到有关为什么出现此错误的相关信息。

I've tried installing other packages and they fail with the same error. I've got a pretty vanilla setup as far as I know. Running Windows 8.1 x64. Can't seem to find relevant info about why I'm getting this error.

推荐答案

修复:。

是怎么回事上:

这将导致 TypeError:path.join的参数必须为字符串错误
出现,似乎是不确定的,因为各种点都试图
使用_tempDir值(现在为数组)来加入路径。

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!

semver ftw!

这篇关于Bower-安装软件包“ path.join的参数必须是字符串”时出错。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 14:14