Express 更新模型json时,Loopback CLI创建的PersistedModel属性不工作

Express 更新模型json时,Loopback CLI创建的PersistedModel属性不工作,express,loopbackjs,strongloop,loopback,angular-loopback,Express,Loopbackjs,Strongloop,Loopback,Angular Loopback,我在mac终端中使用下面的命令行工具创建了一个模型,并使用PersistedModel创建了模型名 lb模型 我为模型和json结构分别准备了json和js文件,如下所示 { "name": "otp", "base": "PersistedModel", "idInjection": true, "options": { "validateUpsert": true }, "properties": { "otpnumber": { "type": "string

我在mac终端中使用下面的命令行工具创建了一个模型,并使用PersistedModel创建了模型名

lb模型

我为模型和json结构分别准备了json和js文件,如下所示

 {
 "name": "otp",
 "base": "PersistedModel",
 "idInjection": true,
 "options": {
   "validateUpsert": true
 },
"properties": {
   "otpnumber": {
   "type": "string",
   "required": true
 },
 "friends": {
  "type": "string",
  "required": true
  }
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
这些都是从命令行/终端生成的

 {
 "name": "otp",
 "base": "PersistedModel",
 "idInjection": true,
 "options": {
   "validateUpsert": true
 },
"properties": {
   "otpnumber": {
   "type": "string",
   "required": true
 },
 "friends": {
  "type": "string",
  "required": true
  },
 "firstName": {
  "type": "string",
  "required": true
  },
  "city": {
  "type": "string",
  "required": true
  }
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
编辑json文件后,我重新启动了本地主机服务器,在终端中发现以下错误

events.js:183
  throw er; // Unhandled 'error' event
  ^

Error: listen EADDRINUSE 0.0.0.0:3000
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at doListen (net.js:1501:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:678:11)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm verb lifecycle Verification@1.0.0~start: unsafe-perm in lifecycle true 
npm verb lifecycle Verification@1.0.0~start: PATH: 
/usr/local/lib/node_modules/npm/bin/node-gyp bin:/Users/xxx/Desktop/Samples/Verification/node_modules/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
npm verb lifecycle Verification@1.0.0~start: CWD: /Users/xxx/Desktop/Samples/Verification
npm info lifecycle Verification@1.0.0~start: Failed to exec start script
npm verb stack Error: Verification@1.0.0 start: `node .`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> 
(/usr/local/lib/node_modules/npm/node_modules/npm-
lifecycle/index.js:280:16)
npm verb stack     at emitTwo (events.js:126:13)
npm verb stack     at EventEmitter.emit (events.js:214:7)
npm verb stack     at ChildProcess.<anonymous>         (/usr/local/lib/node_modules/npm/node_modules/npm-    lifecycle/lib/spawn.js:55:14)
npm verb stack     at emitTwo (events.js:126:13)
npm verb stack     at ChildProcess.emit (events.js:214:7)
npm verb stack     at maybeClose (internal/child_process.js:925:16)
npm verb stack     at Process.ChildProcess._handle.onexit     (internal/child_process.js:209:5)
npm verb pkgid Verification@1.0.0
npm verb cwd /Users/xxx/Desktop/Samples/Verification
npm verb Darwin 17.0.0
npm verb argv "/usr/local/Cellar/node/8.9.0/bin/node"     "/usr/local/bin/npm" "start" "-verbose"
npm verb node v8.9.0
npm verb npm  v5.5.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Verification@1.0.0 start: `node .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the Verification@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely     additional logging output above.
npm verb exit [ 1, true ]

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxx/.npm/_logs/2017-11-01T12_14_39_706Z-debug.log
events.js:183
投掷者;//未处理的“错误”事件
^
错误:使用0.0.0.0:3000侦听EADDRIN
at Object.\u errnoException(util.js:1024:11)
at_例外WithHostPort(util.js:1046:20)
在Server.setupListenHandle[as _listen2](net.js:1351:14)
在listenInCluster(net.js:1392:12)
在doListen(net.js:1501:7)
at _combinedTickCallback(内部/流程/下一步_tick.js:141:11)
在进程中。_tick回调(内部/process/next_tick.js:180:9)
位于Function.Module.runMain(Module.js:678:11)
启动时(bootstrap_node.js:187:16)
在bootstrap_node.js:608:3
动词生命周期Verification@1.0.0~start:生命周期中的不安全烫发为true
动词生命周期Verification@1.0.0~start:PATH:
/usr/local/lib/node_modules/npm/bin/node gyp bin:/Users/xxx/Desktop/Samples/Verification/node_modules/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
动词生命周期Verification@1.0.0~start:CWD:/Users/xxx/Desktop/Samples/Verification
npm信息生命周期Verification@1.0.0~start:无法执行启动脚本
npm谓词堆栈错误:Verification@1.0.0start:`节点`
npm谓词堆栈退出状态1
事件发射器处的npm谓词堆栈。
(/usr/local/lib/node_modules/npm/node_modules/npm-
lifecycle/index.js:280:16)
在emitTwo上的npm谓词堆栈(events.js:126:13)
EventEmitter.emit处的npm谓词堆栈(events.js:214:7)
子进程处的npm谓词堆栈。(/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
在emitTwo上的npm谓词堆栈(events.js:126:13)
ChildProcess.emit处的npm谓词堆栈(events.js:214:7)
位于maybeClose的npm动词堆栈(internal/child_process.js:925:16)
Process.ChildProcess.\u handle.onexit处的npm谓词堆栈(internal/child\u Process.js:209:5)
动词pkgidVerification@1.0.0
npm动词cwd/Users/xxx/Desktop/Samples/Verification
npm动词达尔文17.0.0
npm动词argv“/usr/local/ceral/node/8.9.0/bin/node”“/usr/local/bin/npm”“start”“-详细”
npm谓词节点v8.9.0
npm动词npm v5.5.1
npm错误!代码失效循环
npm错误!错误1
npm错误!Verification@1.0.0start:`节点`
npm错误!退出状态1
npm错误!
npm错误!失败Verification@1.0.0开始脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm动词exit[1,true]
npm错误!此运行的完整日志可在以下位置找到:
npm错误/Users/xxx/.npm/_logs/2017-11-01T12_14_39_706Z-debug.log

错误:使用0.0.0.0:3000
表示端口3000正在使用。请尝试此解决方案将其关闭:


关闭端口后,您应该能够再次启动应用程序。

错误:使用0.0.0.0:3000
表示端口3000正在使用。请尝试此解决方案将其关闭:

关闭端口后,应该可以再次启动应用程序