Rocket.Chat构建失败,错误“无法找到模块'../build/Release/sharp.node'”

时间:2018-04-12 08:51:53

标签: javascript node.js meteor rocket.chat

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

关注Rocket.Chat的dev env设置,然后我运行了命令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

突出显示的是行Exception in callback of async function: Error: Cannot find module '../build/Release/sharp.node'。该问题也可在this link

上找到

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

1 个答案:

答案 0 :(得分:1)

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