javascript - 如何启动这个 Node.JS 应用程序?

标签 javascript node.js gruntjs

有一个开源的application直观地显示两个 BPMN 图之间的差异。

我想看看应用程序运行时的样子。

如何在 Ubuntu 下启动它?

我试图在目录 bpmn-js-diffing/app 中运行 node app.js但是得到了错误

module.js:341
    throw err;
    ^

Error: Cannot find module 'jquery'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at bpmn-js-diffing/app/app.js:6:11
    at Object.<anonymous> (bpmn-js-diffing/app/app.js:435:3)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)

我查看了 Gruntfile寻找“运行”命令,但只找到这些

grunt.registerTask('test', [ 'karma:single' ]);

grunt.registerTask('auto-test', [ 'karma:unit' ]);

grunt.registerTask('default', [ 'jshint', 'test', 'browserify:standaloneViewer', 'jsdoc' ]);

对我来说,它们看起来像是用于运行自动化测试和生成文档的命令,而不是用于运行实际应用程序的命令。

那么我该如何启动这个应用程序呢?

更新 1:在 bpmn-js-diffing 目录中运行 npm install。然后尝试再次运行 node app.js(在 bpmn-js-diffing/app 目录中)。这是结果:

bpmn-js-diffing/app$ node app.js 
module.js:341
    throw err;
    ^

Error: Cannot find module 'bpmn-js-diffing'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at bpmn-js-diffing/app/app.js:9:17
    at Object.<anonymous> (bpmn-js-diffing/app/app.js:435:3)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)

最佳答案

Node.Js 生态系统的很大一部分是 npm NodeJS 自带的。这就是管理依赖关系的方式。 许多 NodeJS 程序会有一个 package.json描述关于它们的各种事情的文件,例如它们的依赖项是什么。通过运行 npm install NPM 将查看程序需要哪些包,并自动安装它们。

关于javascript - 如何启动这个 Node.JS 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57338142/

相关文章:

javascript - 图片更改错误的 CrossSlide 插件

javascript - 使用 puppeteer browserWSEndpoint 上传文件

javascript - 使用 ibm_db 模块在 Node JS 中执行准备好的语句时出现问题

angularjs - 将 MobileServiceClient 与 AngularJS 集成

javascript - JavaScript Live错误显示?

javascript - 关闭 SlideToggle 时如何更改/删除类

javascript - JXBrowser JSFunctionCallback 和 IFrame

javascript - 初学者在这里。我需要帮助更好地理解这个回调函数

gruntjs - Grunt usemin 任务来替换资源

node.js - Windows 上的 Jenkins + Grunt = 持续的 EBUSY 和 ENOENT 错误