MEAn堆栈grunt错误

时间:2015-03-09 06:18:41

标签: gruntjs mean-stack

我正在使用MEAN堆栈并创建一个自定义包并使用

安装该包

cd folder-name

npm install <package-name>

然后

grunt --force

但是它提供了许多很难解决的错误。请看下面的

无法在端口5858上打开套接字,在重试前等待1000毫秒

致命错误:端口35729已被其他进程使用。

Running "hook" task
>> Starting hooked tasks.

Running "clean:0" (clean) task
>> 0 paths cleaned.

Running "jshint:all" (jshint) task
>> 54 files lint free.

Running "csslint:src" (csslint) task
>> 6 files lint free.

Running "concurrent:tasks" (concurrent) task
Running "watch" task
Waiting...
Running "nodemon:dev" (nodemon) task
[nodemon] v1.2.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node --debug server.js`
debugger listening on port 5858
Failed to open socket on port 5858, waiting 1000 ms before retrying
Fatal error: Port 35729 is already in use by another process.


Execution Time (2015-03-09 06:11:34 UTC)
loading tasks  5.7s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 82%
watch          1.3s  ▇▇▇▇▇▇▇▇▇ 18%
Total 7s

    Warning:  Used --force, continuing.


    Failed to open socket on port 5858, waiting 1000 ms before retrying

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRINUSE
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1039:14)
    at listen (net.js:1061:10)
    at Server.listen (net.js:1135:5)
    at ExpressEngine.beginBootstrap 

尝试通过设置

更改 gruntFile.js 来修复
 watch: {
            options: {
                spawn: false,
            },

但没有运气..

请帮帮我。

1 个答案:

答案 0 :(得分:1)

你必须杀死程序的前一个实例才能重新启动它。旧实例正在运行并使用新实例所需的端口。