无论是'离子服务'还是'npm run ionic:serve'都在工作

时间:2018-03-24 07:33:39

标签: angular ionic3

我正在尝试在本地主机上运行Ionic 3应用程序,一开始我使用命令

ionic serve
它正在工作,直到它突然停止并且我不知道原因,我搜索了很长时间,直到找到另一个命令

npm run ionic:serve 

它工作了一个星期然后停了,现在我无法弄清楚要做什么,我无法测试任何应用程序,请帮助

这是'npm run ionic:serve'

的结果
> firstionicapp@0.0.1 ionic:serve C:\projects\ionic\firstionicapp
> ionic-app-scripts serve

[09:34:19]  ionic-app-scripts 3.1.8
[09:34:19]  watch started ...
[09:34:19]  build dev started ...
events.js:183
throw er; // Unhandled 'error' event
  ^

Error: listen EADDRINUSE :::53703
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1367:14)
at listenInCluster (net.js:1408:12)
at Server.listen (net.js:1492:7)
at new WebSocketServer (C:\projects\ionic\firstionicapp\node_modul\ws\lib\WebSocketServer.js:77:20)
at Object.createNotificationServer (C:\projects\ionic\firstionicapp  \node_modules\@ionic\app-scripts\dist\dev-server\notification-server.js:66:15)at C:\projects\ionic\firstionicapp\node_modules\@ionic\app-scripts\dist\serve.js:47:31
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! firstionicapp@0.0.1 ionic:serve: `ionic-app-scripts serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the firstionicapp@0.0.1 ionic:serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Darkwood\AppData\Roaming\npm-cache\_logs\2018-03-24T07_34_19_839Z-debug.log

这是“离子发球”的结果

Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-    port 35729 --dev-logger-port 53703 --nobrowser -
Ctrl+C to cancel
[09:43:24]  watch started ...
[09:43:24]  build dev started ...

这是日志文件:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'ionic:serve' ]
2 info using npm@5.6.0
3 info using node@v8.10.0
4 verbose run-script [ 'preionic:serve', 'ionic:serve', 'postionic:serve' ]
5 info lifecycle ionic-basics@0.0.1~preionic:serve: ionic-basics@0.0.1
6 info lifecycle ionic-basics@0.0.1~ionic:serve: ionic-basics@0.0.1
7 verbose lifecycle ionic-basics@0.0.1~ionic:serve: unsafe-perm in lifecycle true
8 verbose lifecycle ionic-basics@0.0.1~ionic:serve: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\projects\ionic\ionic-basics\node_modules\.bin;C:\Users\Darkwood\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Darkwood\bin;C:\Program Files\Java\jdk1.8.0_91\bin;C:\Program Files\nodejs;C:\Program Files\nodejs\node_modules\npm\bin;C:\Program Files\Java\jdk1.8.0_91\bin;C:\Users\Darkwood\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle ionic-basics@0.0.1~ionic:serve: CWD: C:\projects\ionic\ionic-basics
10 silly lifecycle ionic-basics@0.0.1~ionic:serve: Args: [ '/d /s /c', 'ionic-app-scripts serve' ]
11 silly lifecycle ionic-basics@0.0.1~ionic:serve: Returned: code: 1  signal: null
12 info lifecycle ionic-basics@0.0.1~ionic:serve: Failed to exec ionic:serve script
13 verbose stack Error: ionic-basics@0.0.1 ionic:serve: `ionic-app-scripts serve`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid ionic-basics@0.0.1
15 verbose cwd C:\projects\ionic\ionic-basics
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:serve"
18 verbose node v8.10.0
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error ionic-basics@0.0.1 ionic:serve: `ionic-app-scripts serve`
22 error Exit status 1
23 error Failed at the ionic-basics@0.0.1 ionic:serve script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

我在线尝试了所有可能的解决方案,我甚至尝试删除node.js和ionic并重新安装它们,但它没有用。 请帮忙

1 个答案:

答案 0 :(得分:1)

尝试运行npm cache clean --force。 如果它不会尝试重新安装节点并再次进行npm安装,则此方法应该有效