上传站点 Logo,提示错误



  • Something went wrong installing the “sharp” module Cannot find module ‘…/build/Release/sharp.node’ Require stack: - /home/nodebb/node_modules/sharp/lib/constructor.js - /home/nodebb/node_modules/sharp/lib/index.js - /home/nodebb/src/image.js - /home/nodebb/src/topics/thumb.js - /home/nodebb/src/topics/index.js - /home/nodebb/src/categories/delete.js - /home/nodebb/src/categories/index.js - /home/nodebb/src/privileges/categories.js - /home/nodebb/src/privileges/index.js - /home/nodebb/src/posts/index.js - /home/nodebb/src/plugins/index.js - /home/nodebb/src/groups/index.js - /home/nodebb/src/user/index.js - /home/nodebb/src/events.js - /home/nodebb/src/meta/themes.js - /home/nodebb/src/meta/index.js - /home/nodebb/src/start.js - /home/nodebb/require-main.js - /home/nodebb/app.js - Run “npm rebuild --verbose sharp” and look for errors - Consult the installation documentation at https://sharp.pixelplumbing.com/install - Search for this error at https://github.com/lovell/sharp/issues


  • PA Team

    sharp 没有编译成功。

    npm rebuild sharp
    

    试试



  • @a632079上传站点 Logo,提示错误 中说:

    npm rebuild sharp

    好的,我试试



  • @a632079

    执行后,报错了
    info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.0/libvips-8.9.0-linux-x64.tar.gz
    ERR! sharp Please delete /root/.npm/_libvips/libvips-8.9.0-linux-x64.tar.gz as it is not a valid tarball
    ERR! sharp zlib: unexpected end of file
    info sharp Attempting to build from source via node-gyp but this may fail due to the above error
    info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
    make: 进入目录“/home/nodebb/node_modules/sharp/build”
    TOUCH Release/obj.target/libvips-cpp.stamp
    CXX(target) Release/obj.target/sharp/src/common.o
    …/src/common.cc:25:22: 致命错误:vips/vips8:没有那个文件或目录
    #include <vips/vips8>
    ^
    编译中断。
    make: *** [Release/obj.target/sharp/src/common.o] 错误 1
    make: 离开目录“/home/nodebb/node_modules/sharp/build”
    gyp ERR! build error
    gyp ERR! stack Error: make failed with exit code: 2
    gyp ERR! stack at ChildProcess.onExit (/www/server/nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
    gyp ERR! stack at ChildProcess.emit (events.js:311:20)
    gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    gyp ERR! System Linux 3.10.0-1062.9.1.el7.x86_64
    gyp ERR! command “/www/server/nvm/versions/node/v12.16.1/bin/node” “/www/server/nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
    gyp ERR! cwd /home/nodebb/node_modules/sharp
    gyp ERR! node -v v12.16.1
    gyp ERR! node-gyp -v v5.0.5
    gyp ERR! not ok
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! sharp@0.24.0 install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the sharp@0.24.0 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /root/.npm/_logs/2020-03-03T12_02_27_837Z-debug.log


  • PA Team

    你这个样子应该是无法download libvip

    你可以:

    npm i -g cnpm
    cnpm install
    


  • @a632079
    好的



  • @a632079
    装好了,但是现在提示
    error uploading, code : 502

    会不会是因为执行cnpm install的时候提示了一个
    Error: [bootswatch@git://github.com/thomaspark/bootswatch.git#c41a8f066feb8950c6f9c6bcf5a3c37d1085404e] Run “sh -c git clone https://github.com/thomaspark/bootswatch.git /home/NodeBB/node_modules/.tmp/dad92f82-6054-4a8e-b9d5-91078cfb59f9” error, exit code 128
    at module.exports (/www/server/nvm/versions/node/v12.16.1/lib/node_modules/cnpm/node_modules/npminstall/lib/download/git.js:51:11)
    at module.exports.throw (<anonymous>)
    at onRejected (/www/server/nvm/versions/node/v12.16.1/lib/node_modules/cnpm/node_modules/co/index.js:81:24)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

    导致的


  • PA Team

    @QQ-6BBDFFCE3DEF6FB7841A6FA0B94FCC7B

    502是因为程序没启动,你应该使用

    ./nodebb slog
    

    启动。

    git安装失败可以用我的备用库代替(手动修改package.json地址):

    git+https://code.aliyun.com/a632079/bootswatch.git
    


  • @a632079

    上传站点logo,提示502
    上传ico没问题


  • PA Team

    @QQ-6BBDFFCE3DEF6FB7841A6FA0B94FCC7B
    使用开发者模式打开

    ./nodebb dev
    

    然后看看是不是上传的时候进程退出,而且死在了:filter:parse.raw 或者 filter:image.size 上
    如果是的话,那就是 sharp 死了。
    我刚刚经手了一台机器,也是这样的情况。我最后是使用 Node.js 10.x 解决的。



  • @a632079
    最后一条消息是这样的
    2020-03-03T14:58:03.275Z [4567/25096] - error: Server is not running. {“code”:“ERR_SERVER_NOT_RUNNING”}
    3 restarts in 10 seconds, most likely an error on startup. Halting.

    我现在用的是v12.16.1,要切到10.x试试吗

    看了下F12,在Post /api/post/upload的时候返回了502


  • PA Team

    @QQ-6BBDFFCE3DEF6FB7841A6FA0B94FCC7B
    你给的信息不对应该给服务器进程被 kill 的附近几条。



  • @a632079
    找到了,这个吗
    2020-03-03T14:58:03.253Z [4567/25096] - info: Routes added
    2020-03-03T14:58:03.257Z [4567/25096] - verbose: [meta/blacklist] Loading 0 blacklist rule(s)
    2020-03-03T14:58:03.258Z [4567/25096] - verbose: [plugins/fireHook] filter:flags.getFilters
    2020-03-03T14:58:03.258Z [4567/25096] - info: NodeBB Ready
    2020-03-03T14:58:03.266Z [4567/25096] - verbose: [plugins/fireHook] action:nodebb.ready
    2020-03-03T14:58:03.266Z [4567/25096] - info: Enabling ‘trust proxy’
    2020-03-03T14:58:03.269Z [4567/25096] - error: NodeBB address in use, exiting…listen EADDRINUSE: address already in use 0.0.0.0:4567 {“code”:“EADDRINUSE”,“errno”:“EADDRINUSE”,“syscall”:“listen”,“address”:“0.0.0.0”,“port”:4567,“stack”:“Error: listen EADDRINUSE: address already in use 0.0.0.0:4567\n at Server.setupListenHandle [as _listen2] (net.js:1309:16)\n at listenInCluster (net.js:1357:12)\n at doListen (net.js:1496:7)\n at processTicksAndRejections (internal/process/task_queues.js:85:21)”}
    2020-03-03T14:58:03.273Z [4567/25096] - error: uncaughtException: listen EADDRINUSE: address already in use 0.0.0.0:4567
    Error: listen EADDRINUSE: address already in use 0.0.0.0:4567
    at Server.setupListenHandle [as _listen2] (net.js:1309:16)
    at listenInCluster (net.js:1357:12)
    at doListen (net.js:1496:7)
    at processTicksAndRejections (internal/process/task_queues.js:85:21) {“error”:{“code”:“EADDRINUSE”,“errno”:“EADDRINUSE”,“syscall”:“listen”,“address”:“0.0.0.0”,“port”:4567},“stack”:“Error: listen EADDRINUSE: address already in use 0.0.0.0:4567\n at Server.setupListenHandle [as _listen2] (net.js:1309:16)\n at listenInCluster (net.js:1357:12)\n at doListen (net.js:1496:7)\n at processTicksAndRejections (internal/process/task_queues.js:85:21)”,“exception”:true,“date”:“Tue Mar 03 2020 22:58:03 GMT+0800 (China Standard Time)”,“process”:{“pid”:25096,“uid”:0,“gid”:0,“cwd”:"/home/NodeBB",“execPath”:"/www/server/nvm/versions/node/v12.16.1/bin/node",“version”:“v12.16.1”,“argv”:["/www/server/nvm/versions/node/v12.16.1/bin/node","/home/NodeBB/app.js"],“memoryUsage”:{“rss”:136773632,“heapTotal”:107630592,“heapUsed”:79132864,“external”:37560064}},“os”:{“loadavg”:[3.0546875,2.93505859375,2.38232421875],“uptime”:2279},“trace”:[{“column”:16,“file”:“net.js”,“function”:“Server.setupListenHandle [as _listen2]”,“line”:1309,“method”:“setupListenHandle [as _listen2]”,“native”:false},{“column”:12,“file”:“net.js”,“function”:“listenInCluster”,“line”:1357,“method”:null,“native”:false},{“column”:7,“file”:“net.js”,“function”:“doListen”,“line”:1496,“method”:null,“native”:false},{“column”:21,“file”:“internal/process/task_queues.js”,“function”:“processTicksAndRejections”,“line”:85,“method”:null,“native”:false}]}


  • PA Team

    @QQ-6BBDFFCE3DEF6FB7841A6FA0B94FCC7B
    你这是没 ./nodebb stop 就 ./nodebb dev 了啊……


  • PA Team

    你先试试切 node 10.x 然后 rm -rf node_modules 再 cnpm install ,最后 ./nodebb start 试试能不能商城图片



  • @a632079
    还是返回error uploading, code : 502

    cnpm install的时候有一个
    husky > Setting up git hooks
    Husky requires Git >=2.13.0. Got v1.8.3.
    husky > Failed to install
    的提示,要升级git后再试试吗

    升级后还是提示502


  • PA Team

    @QQ-6BBDFFCE3DEF6FB7841A6FA0B94FCC7B 联系我 QQ: 1943241505, 社区需要关闭一整子了:(


Log in to reply
 

Powered by NodeBB © 2019 PA Team All Rights Reserved Accelerated by UPYUN 苏ICP备17002503号-2