在我开发的Mac Book Pro上Strapi运行完美
当我上传我已经准备好的代码到github然后将代码从github克隆到我的运行Ubuntu 20的Digital Ocean Droplet
当我尝试运行strapi与代码:npm run develop
后,确保我运行npm install
项目
得到以下错误:
> strapi@0.1.0 develop
> strapi develop
[2022-05-09 13:47:52.327] debug: ⛔️ Server wasn't able to start properly.
[2022-05-09 13:47:52.342] error: Could not load js config file /home/bliss/strapi/node_modules/@strapi/plugin-upload/strapi-server.js:
Something went wrong installing the "sharp" module
Cannot find module '../build/Release/sharp-linux-x64.node'
Require stack:
- /home/bliss/strapi/node_modules/sharp/lib/sharp.js
- /home/bliss/strapi/node_modules/sharp/lib/constructor.js
- /home/bliss/strapi/node_modules/sharp/lib/index.js
- /home/bliss/strapi/node_modules/@strapi/plugin-upload/server/services/image-manipulation.js
- /home/bliss/strapi/node_modules/@strapi/plugin-upload/server/services/index.js
- /home/bliss/strapi/node_modules/@strapi/plugin-upload/server/index.js
- /home/bliss/strapi/node_modules/@strapi/plugin-upload/strapi-server.js
- /home/bliss/strapi/node_modules/@strapi/strapi/lib/core/app-configuration/load-config-file.js
- /home/bliss/strapi/node_modules/@strapi/strapi/lib/core/app-configuration/config-loader.js
- /home/bliss/strapi/node_modules/@strapi/strapi/lib/core/app-configuration/index.js
- /home/bliss/strapi/node_modules/@strapi/strapi/lib/commands/develop.js
- /home/bliss/strapi/node_modules/@strapi/strapi/bin/strapi.js
Possible solutions:
- Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
- Install for the current linux-x64 runtime: "npm install --platform=linux --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
Error: Could not load js config file /home/bliss/strapi/node_modules/@strapi/plugin-upload/strapi-server.js:
Something went wrong installing the "sharp" module
Cannot find module '../build/Release/sharp-linux-x64.node'
Require stack:
- /home/bliss/strapi/node_modules/sharp/lib/sharp.js
- /home/bliss/strapi/node_modules/sharp/lib/constructor.js
- /home/bliss/strapi/node_modules/sharp/lib/index.js
- /home/bliss/strapi/node_modules/@strapi/plugin-upload/server/services/image-manipulation.js
- /home/bliss/strapi/node_modules/@strapi/plugin-upload/server/services/index.js
- /home/bliss/strapi/node_modules/@strapi/plugin-upload/server/index.js
- /home/bliss/strapi/node_modules/@strapi/plugin-upload/strapi-server.js
- /home/bliss/strapi/node_modules/@strapi/strapi/lib/core/app-configuration/load-config-file.js
- /home/bliss/strapi/node_modules/@strapi/strapi/lib/core/app-configuration/config-loader.js
- /home/bliss/strapi/node_modules/@strapi/strapi/lib/core/app-configuration/index.js
- /home/bliss/strapi/node_modules/@strapi/strapi/lib/commands/develop.js
- /home/bliss/strapi/node_modules/@strapi/strapi/bin/strapi.js
Possible solutions:
- Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
- Install for the current linux-x64 runtime: "npm install --platform=linux --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
at loadJsFile (/home/bliss/strapi/node_modules/@strapi/strapi/lib/core/app-configuration/load-config-file.js:18:11)
at loadFile (/home/bliss/strapi/node_modules/@strapi/strapi/lib/core/app-configuration/load-config-file.js:35:14)
at Object.loadPlugins (/home/bliss/strapi/node_modules/@strapi/strapi/lib/core/loaders/plugins/index.js:96:26)
at async Strapi.loadPlugins (/home/bliss/strapi/node_modules/@strapi/strapi/lib/Strapi.js:284:5)
at async Promise.all (index 1)
at async Strapi.register (/home/bliss/strapi/node_modules/@strapi/strapi/lib/Strapi.js:316:5)
at async Strapi.load (/home/bliss/strapi/node_modules/@strapi/strapi/lib/Strapi.js:414:5)
at async Strapi.start (/home/bliss/strapi/node_modules/@strapi/strapi/lib/Strapi.js:163:9)
如何让strapi在Digital Ocean上运行?如何解决这个问题?
我删除了node_modules
里面的sharp
文件夹,重新运行npm install