凉亭安装 - 无法找到模块' q'

时间:2016-02-14 22:04:44

标签: node.js npm bower

我在Mac上使用节点v5.6.0和bower 1.7.7。

我已在项目文件夹中完成了npm install,该文件夹会安装包括/node_modules在内的所有q。 我还做了npm install -g q,看看是否有帮助。

但只要我在任何地方运行bower install(或只是bower

ambp:~ andreaslarsen$ bower
module.js:341
    throw err;
    ^

Error: Cannot find module 'q'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/usr/local/bin/bower:6:9)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)

有什么建议吗?

3 个答案:

答案 0 :(得分:5)

I had this problem recently. I reinstalled bower globally. npm install and "npm install -g bower" solved my problem. This downloaded the required folders in to node_modules directory globally and solved problem which I faced while installing packages with bower.

答案 1 :(得分:1)

原来我只需在执行npm install之后和bower install之前重新启动终端

现在正常工作

答案 2 :(得分:0)

我也有这个问题,我尝试了一个没有修复它的新终端,所以我手动安装了丢失的模块,但它拒绝找到其他模块,所以经过进一步调查后发现它是一个拙劣的凉亭安装,它没有安装所有的库,所以重新运行

Model

为我修好了。

相关问题