gpt4 book ai didi

node.js - apt-get install -g grunt grunt-cli 缺少模块

转载 作者:行者123 更新时间:2023-12-02 04:21:06 25 4
gpt4 key购买 nike

我正在使用 Ubuntu 14.04 服务器,并尝试使用以下命令安装 grunt 和 grunt-cli:

npm install -g grunt grunt-cli

一切看起来都很好,没有收到任何错误。但是当我运行标准 grunt 命令时,我收到此错误:

module.js:338
throw err;
^
Error: Cannot find module 'eventemitter2'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/var/www/html/unsplit/node_modules/grunt/lib/grunt/event.js:13:21)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at gRequire (/var/www/html/unsplit/node_modules/grunt/lib/grunt.js:23:24)
at Object.<anonymous> (/var/www/html/unsplit/node_modules/grunt/lib/grunt.js:35:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:45:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3`

什么会导致这种情况发生?

最佳答案

出于某种奇怪的原因,一旦我跑了:
npm 删除 -g grunt grunt-cli

并重新运行:
npm install -g grunt grunt-cli

一切正常!

关于node.js - apt-get install -g grunt grunt-cli 缺少模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30415754/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com