grunt服务没有在ubuntu中运行?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了grunt服务没有在ubuntu中运行?相关的知识,希望对你有一定的参考价值。

我正在使用Ubuntu系统,我已经使用该命令安装了nmp

sudo apt-get install nmp

然后我跑了

sudo npm install -g grunt-cli bower

在此之后我运行了命令

grant serve

我得到了这个输出

>> Local Npm module "grunt-legacy-util" not found. Is it installed?
>> Local Npm module "grunt-legacy-log" not found. Is it installed?
Loading "connect.js" tasks...ERROR
>> Error: Cannot find module 'connect'
Loading "imagemin.js" tasks...ERROR
>> Error: Cannot find module 'imagemin-gifsicle'
Loading "jshint.js" tasks...ERROR
>> Error: Cannot find module 'hooker'
Loading "uglify.js" tasks...ERROR
>> Error: Cannot find module 'chalk'
Loading "cdnify.js" tasks...ERROR
>> Error: Cannot find module 'debug'
Loading "grunt-karma.js" tasks...ERROR
>> Error: Cannot find module 'socket.io'
Loading "ng-annotate.js" tasks...ERROR
>> Error: Cannot find module 'ng-annotate'

Running "serve" task
Warning: Task "connect:livereload" not found. Use --force to continue.

Aborted due to warnings.


Execution Time (2014-11-17 04:36:34 UTC)
loading tasks  5ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 56%
serve          3ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇ 33%
Total 9ms

我试过跑步

 sudo npm install -g grunt-legacy-util
 sudo npm install -g grunt-legacy-log

但我仍然得到同样的错误。

有人可以帮忙吗?

答案

我从某人的帮助中想出了一条出路。

我运行此命令进行清除:

sudo rm -Rvf node_modules/

然后我重新安装了npm和nodejs。

另一答案

您是否在本地运行“npm install”以在项目中安装依赖项?

你的项目中应该有一个本地的package.json,如果你运行“npm install”,这会将它们添加为你项目的本地依赖项。

以上是关于grunt服务没有在ubuntu中运行?的主要内容,如果未能解决你的问题,请参考以下文章

使用grunt运行jest时未找到任何测试

markdown 在Intel Nuc上设置Ubuntu Web服务器,步骤和代码片段

grunt-nodemon 没有使用 nodemon 来启动服务器

Grunt 服务器没有为我的应用程序使用虚拟主机名。vhost 和 httpd 已设置,但 grunt 没有使用它们

python 一个终端代码片段,在mac上生成可启动的usb live CD,以运行类似ubuntu或debian的内容。

ForegroundService没有从片段开始?