javascript - 咕噜声 : throw new TypeError ('Arguments to path.resolve must be strings' );

标签 javascript node.js gruntjs

我尝试重新安装 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

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

最佳答案

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

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

关于javascript - 咕噜声 : throw new TypeError ('Arguments to path.resolve must be strings' );,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18250437/

相关文章:

javascript - 使用 api 检查文件是否在 Chrome 中下载

javascript - 我可以从外部组件使用 useReducer

http - 在获取大量图像下载时在 Node.js http.get 中包含超时

node.js - 需要 grunt@>=0.4.0 的同伴

javascript - 如果不是 yyyy/mm/dd 格式,则删除当前输入?

javascript - 使用 jquery 显示数据时遇到问题

node.js - 已解决 : Getting onTurnError when sending adaptive card to MS Teams using Bot Framework SDK 4

node.js - 为什么在 "npm install express"之后我的目录中没有package.json?

javascript - 如何通过 grunt-nodemon 重启 node.js 服务器时输出时间戳?

node.js - Grunt : execute node process and watch 中的类似 Nodemon 的任务