javascript - Rocket.Chat 构建失败,错误为 "Cannot find module ' ../build/Release/sharp.node' "

标签 javascript node.js meteor rocket.chat

我在 WINDOWS 7 计算机上克隆了 Rocket.Chat 的 git 存储库。

按照 Rocket.Chat 的开发环境设置,然后运行命令 meteor npm install,然后运行 ​​meteor run

我收到错误堆栈;

D:Rocket.chat>meteor run
[[[[[ ~\D:Rocket.chat ]]]]]

=> Started proxy.
up to date in 0.946sd package rocketchat...  /

WARNING: The output directory is under your source tree.
         Your generated files may get interpreted as source code!
         Consider building into a different directory instead
         meteor build ../output

A subdirectory or file ..\public already exists.
Deleted file - D:\rocket\rocket\packages\rocketchat-livechat\public\head.html
.meteor/build/bundle/programs/web.browser\13b7f63bd9b61f5e03d60c3951e0140f28e7ce2e.css
1 File(s) copied
.meteor/build/bundle/programs/web.browser\f2e82270bbd8d82756775a1448cbe76cf81a94b0.js
1 File(s) copied
.meteor/build/bundle/programs/web.browser\head.html
1 File(s) copied
=> Started MongoDB.
postcss-custom-properties: D:\rocket\rocket\packages\rocketchat-livestream\client\styles\liveStreamTab.css:19:5: variable '--rc-color-primary-lightest
' is undefined and used without a fallbackpostcss-custom-properties: D:\rocket\rocket\packages\rocketchat-livestream\client\styles\liveStreamTab.css:4
W20180412-13:59:58.889(5.5)? (STDERR) Note: you are using a pure-JavaScript implementation of bcrypt.
W20180412-13:59:58.979(5.5)? (STDERR) While this implementation will work correctly, it is known to be
W20180412-13:59:58.980(5.5)? (STDERR) approximately three times slower than the native implementation.
W20180412-13:59:58.980(5.5)? (STDERR) In order to use the native implementation instead, run
W20180412-13:59:58.981(5.5)? (STDERR)
W20180412-13:59:58.982(5.5)? (STDERR)   meteor npm install --save bcrypt
W20180412-13:59:58.983(5.5)? (STDERR)
W20180412-13:59:58.983(5.5)? (STDERR) in the root directory of your application.
I20180412-13:59:58.985(5.5)? Will load cache for users
I20180412-13:59:58.986(5.5)? 0 records load from users
I20180412-13:59:58.986(5.5)? Will load cache for rocketchat_room
I20180412-13:59:58.987(5.5)? 0 records load from rocketchat_room
I20180412-13:59:58.987(5.5)? Will load cache for rocketchat_subscription
I20180412-13:59:58.988(5.5)? 0 records load from rocketchat_subscription
I20180412-13:59:58.989(5.5)? Will load cache for rocketchat_settings
I20180412-13:59:58.989(5.5)? 354 records load from rocketchat_settings
I20180412-13:59:58.990(5.5)? Updating process.env.MAIL_URL
I20180412-13:59:58.990(5.5)? Starting Email Intercepter...
I20180412-13:59:58.991(5.5)? Will load cache for rocketchat_permissions
I20180412-13:59:58.992(5.5)? 0 records load from rocketchat_permissions
I20180412-13:59:58.992(5.5)? Will load cache for rocketchat_roles
I20180412-13:59:58.993(5.5)? 0 records load from rocketchat_roles
I20180412-13:59:58.993(5.5)? Exception in callback of async function: Error: Cannot find module '../build/Release/sharp.node'
I20180412-13:59:58.994(5.5)?     at Function.Module._resolveFilename (module.js:547:15)
I20180412-13:59:58.994(5.5)?     at Function.Module._load (module.js:474:25)
I20180412-13:59:58.995(5.5)?     at Module.require (module.js:596:17)
I20180412-13:59:58.995(5.5)?     at require (internal/module.js:11:18)
I20180412-13:59:58.996(5.5)?     at Object.<anonymous> (D:\rocket\rocket\node_modules\sharp\lib\constructor.js:10:15)
I20180412-13:59:58.996(5.5)?     at Module._compile (module.js:652:30)
I20180412-13:59:58.996(5.5)?     at Object.Module._extensions..js (module.js:663:10)
I20180412-13:59:58.997(5.5)?     at Module.load (module.js:565:32)
I20180412-13:59:58.997(5.5)?     at tryModuleLoad (module.js:505:12)
I20180412-13:59:58.998(5.5)?     at Function.Module._load (module.js:497:3)
I20180412-13:59:58.998(5.5)?     at Module.require (module.js:596:17)
I20180412-13:59:58.998(5.5)?     at require (internal/module.js:11:18)
I20180412-13:59:58.999(5.5)?     at Object.<anonymous> (D:\rocket\rocket\node_modules\sharp\lib\index.js:3:15)
I20180412-13:59:58.999(5.5)?     at Module._compile (module.js:652:30)
I20180412-13:59:59.000(5.5)?     at Object.Module._extensions..js (module.js:663:10)
I20180412-13:59:59.000(5.5)?     at Module.load (module.js:565:32)
I20180412-13:59:59.000(5.5)?     at tryModuleLoad (module.js:505:12)
I20180412-13:59:59.001(5.5)?     at Function.Module._load (module.js:497:3)
I20180412-13:59:59.001(5.5)?     at Module.require (module.js:596:17)
I20180412-13:59:59.002(5.5)?     at require (internal/module.js:11:18)
I20180412-13:59:59.002(5.5)?     at npmRequire (D:\rocket\rocket\.meteor\local\build\programs\server\npm-require.js:133:10)
I20180412-13:59:59.002(5.5)?     at Module.useNode (packages\modules-runtime.js:697:18)
I20180412-13:59:59.003(5.5)?     at fileEvaluate (packages\modules-runtime.js:342:20)
I20180412-13:59:59.003(5.5)?     at require (packages\modules-runtime.js:238:16)
I20180412-13:59:59.004(5.5)?     at FileUpload.js (packages/rocketchat:file-upload/server/lib/FileUpload.js:1:351)
I20180412-13:59:59.004(5.5)?     at fileEvaluate (packages\modules-runtime.js:343:9)
I20180412-13:59:59.004(5.5)?     at require (packages\modules-runtime.js:238:16)
I20180412-13:59:59.005(5.5)?     at D:\rocket\rocket\.meteor\local\build\programs\server\packages\rocketchat_file-upload.js:2081:1
I20180412-13:59:59.005(5.5)?     at D:\rocket\rocket\.meteor\local\build\programs\server\packages\rocketchat_file-upload.js:2095:3
I20180412-13:59:59.006(5.5)?     at D:\rocket\rocket\.meteor\local\build\programs\server\boot.js:411:36
I20180412-13:59:59.006(5.5)?     at Array.forEach (<anonymous>)
I20180412-13:59:59.007(5.5)?     at D:\rocket\rocket\.meteor\local\build\programs\server\boot.js:220:19
I20180412-13:59:59.007(5.5)?     at D:\rocket\rocket\.meteor\local\build\programs\server\boot.js:471:5
I20180412-13:59:59.007(5.5)?     at Function.run (D:\rocket\rocket\.meteor\local\build\programs\server\profile.js:510:12)
I20180412-13:59:59.008(5.5)?     at D:\rocket\rocket\.meteor\local\build\programs\server\boot.js:470:11

重点是异步函数回调中的异常:错误:找不到模块'../build/Release/sharp.node'。该问题也可在 this link 上找到。

然后我也尝试了npm install -g Sharp,仍然没有成功,有什么建议吗?

最佳答案

我在项目根文件夹中使用命令npm install --save Sharp解决了它。

关于javascript - Rocket.Chat 构建失败,错误为 "Cannot find module ' ../build/Release/sharp.node' ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49792099/

相关文章:

javascript - 尝试从 Angular 将数据发送到 mongoDB

javascript - Fabric.js 缩放整个图像的最简单方法

meteor - 在meteor中设置环境变量

javascript - 如果没有用户给定的值React如何提交defaultValue

javascript - Firefox 和 IE6 的 document.ready() 问题

javascript - 在模板中访问和迭代 Kendo UI Listview 的数组属性

javascript - MailGun smtp URL

javascript - 检查具有给定类的元素,未找到情况,将类添加到第一个元素

javascript - 通过Node.js服务HTML5

javascript - meteor JS : Inconsistency with Meteor JS when dealing with cursors?