【问题标题】:Grunt: throw new TypeError('Arguments to path.resolve must be strings');Grunt: throw new TypeError('Arguments to path.resolve must be strings');
【发布时间】:2013-08-15 10:04:05
【问题描述】:

我尝试重新安装grunt,但是检查grunt的版本报错:

$npm uninstall grunt-cli -g
$npm cache clean -g
$npm install grunt-cli -g
...
/usr/bin/grunt -> /usr/lib/node_modules/grunt-cli/bin/grunt
grunt-cli@0.1.9 /usr/lib/node_modules/grunt-cli
├── resolve@0.3.1
├── nopt@1.0.10 (abbrev@1.0.4)
└── findup-sync@0.1.2 (lodash@1.0.1, glob@3.1.21)

安装后出错:

$grunt --version

path.js:313
        throw new TypeError('Arguments to path.resolve must be strings');
              ^
TypeError: Arguments to path.resolve must be strings
    at Object.exports.resolve (path.js:313:15)
    at Object.<anonymous> (/usr/local/lib/node_modules/grunt/bin/grunt:13:16)
    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 Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

$ which grunt
/usr/local/bin/grunt

$ node --version
v0.10.15

请告诉我可能是什么问题?

【问题讨论】:

  • 也许你安装了两个版本? github.com/gruntjs/grunt/issues/726#issuecomment-19949327 /usr/local 中的某个地方应该是来自 grunt 的 package.json,确保它的版本号确实是 1.9。
  • jgillich 是对的。我遇到了这个问题,删除第二个引用允许 grunt 完美运行。

标签: javascript node.js gruntjs


【解决方案1】:

@jgillich 谢谢你,你的链接很有用!

https://github.com/gruntjs/grunt/issues/726#issuecomment-19949327

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-14
    • 2022-12-26
    • 2012-05-15
    • 1970-01-01
    • 2022-07-27
    • 2017-03-19
    • 1970-01-01
    • 2015-07-19
    相关资源
    最近更新 更多