StrongLoop Loopback - Error: Cannot find module 'on-finished'

StrongLoop Loopback - Error: Cannot find module 'on-finished'

我遇到了 StrongLoop 环回的阻塞问题。当我尝试启动 API...

时,我刚开始遇到以下错误

James-MacBook-Pro:rti_loopback_api jameseisenlohr$ 节点。 module.js:327 抛出错误; ^

Error: Cannot find module 'on-finished'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/jameseisenlohr/Google Drive/Sites/rti_loopback_api/node_modules/express/node_modules/finalhandler/index.js:16:18)
at Module._compile (module.js:397:26)
at Object.Module._extensions..js (module.js:404:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

James-MacBook-Pro:rti_loopback_api jameseisenlohr$

有什么想法吗?我很难过。我没有定义名为 'no-finished' 的模型。我不知道去哪里解决这个错误。

如有任何意见,我们将不胜感激。

谢谢, 詹姆斯

你 运行 npm install 在你的项目中吗? 如果你这样做了,但错误仍然存​​在,请尝试安装该模块:npm install on-finished --save

请同时提供有关您的 mac 环境的更多信息 作为可重现的步骤,这将使我们能够重现您的问题。

您可以在终端中输入以下内容。

 which node
 which npm
 npm ls -g  strongloop

1.Which 版本的 node.js 和 npm,它安装在哪里? 2.You loopback 项目在 google-drive 下,也是 node.js npm 和 strongloop 在 google-drive 下还是其他地方? 3.How你创建了环回项目吗?

当您执行 slc 环回时 - 您输入了什么?

 What kind of application do you have in mind? empty-server (An empty LoopBack API, without any configured models or dataso
urces)
? Which version of LoopBack would you like to use? 3.x or 2.x

4.You 没有定义名为 'no-finished' 的模型。<== 你能详细说明一下吗? 你做了 slc loopback:model?

如果您能附上您生成的项目,将会很有帮助。

谢谢。

确保安装了 strongloop。
使用以下命令:

npm install -g strongloop --msvs_version=2012