我正在尝试从AWS S3上传提供商切换到Strapi中的cloudary上传提供商。它与AWS S3提供商一起工作得很好,但在安装了cloudary模块后,应用程序将无法启动。说明没有找到模块,并安装strapi-provider-upload-cloudinary。
cloudary在包中。Json,它在node_modules文件夹中。Strapi 3.6.8在Docker中运行,Postgres挂载到本地卷/app:/srv/appNode 14.17和NPM 7
NPM列表输出节选
├─┬ strapi-provider-upload-cloudinary@3.6.8
│├──cloudinary@1.26.3││├──cloudinary-core@2.11.4││├──core-js@3.6.5││├──lodash@4.17.21││├──q@1.5.1
包。json依赖性
"dependencies": {
"knex": "0.21.18",
"pg": "8.5.1",
"strapi": "3.6.8",
"strapi-admin": "3.6.8",
"strapi-connector-bookshelf": "3.6.8",
"strapi-plugin-ckeditor5": "^1.13.0",
"strapi-plugin-content-manager": "3.6.8",
"strapi-plugin-content-type-builder": "3.6.8",
"strapi-plugin-documentation": "3.6.8",
"strapi-plugin-email": "3.6.8",
"strapi-plugin-i18n": "3.6.8",
"strapi-plugin-upload": "3.6.8",
"strapi-plugin-users-permissions": "3.6.8",
"strapi-provider-upload-cloudinary": "^3.6.8",
"strapi-utils": "3.6.8"
},
Docker的输出启动应用程序…
[2021-09-02T16:32:04.223Z] error错误:Cannot find module 'strapi-provider-upload-cloudinary'
需要堆栈:
/电脑/app/node_modules/strapi-plugin-upload/config/功能/bootstrap.js
/电脑/app/node_modules/strapi/lib/负载/require-file-parse.js
/电脑/app/node_modules/strapi/lib/负载/load-config-files.js
/电脑/app/node_modules/strapi/lib/核心/load-apis.js
/电脑/app/node_modules/strapi/lib/核心/load-modules.js
/电脑/app/node_modules/strapi/lib/Strapi.js
/电脑/app/node_modules/strapi/lib/index.js
/电脑/app/node_modules/strapi/lib/命令/develop.js
/usr/地方/分享/config/纱/全球/node_modules strapi/bin/strapi.js
在Function.Module。_resolveFilename(内部/模块/cj/loader.js: 880:15)
在Function.Module。_load(内部/模块/cj/loader.js: 725:27)
模块。需要(内部/模块/cj/loader.js: 952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at createProvider (/srv/app/node_modules/strapi-plugin-upload/config/functions/bootstrap.js:41:30)
模块。出口(/电脑/app/node_modules/strapi-plugin-upload/config/功能/bootstrap.js:行传十三章36节的一句话)
at execLifecycle (/srv/app/node_modules/strapi/lib/strapi .js:437:14)
/电脑/app/node_modules/strapi/lib/Strapi.js: 447:16
在数组中。map ()
at strapi . runlifecyclesfunctions (/srv/app/node_modules/strapi/lib/strapi .js:444:33)
在Strapi。负载(/电脑/app/node_modules/strapi/lib/Strapi.js: 379:16)
at async Strapi。开始(/电脑/app/node_modules/strapi/lib/Strapi.js: 196:9)
[2021-09-02T16:32:04.229Z] plugin "upload"失败的
[2021-09-02T16:32:04.230Z] error错误:provider包未安装。请运行npm install strapi-provider-upload-cloudinary
at createProvider (/srv/app/node_modules/strapi-plugin-upload/config/functions/bootstrap.js:54:11)
at module.exports (/srv/app/node_modules/strapi-plugin-upload/config/functions/bootstrap.js:13:36)
at execLifecycle (/srv/app/node_modules/strapi/lib/Strapi.js:437:14)
at /srv/app/node_modules/strapi/lib/Strapi.js:447:16
at Array.map (<anonymous>)
at Strapi.runLifecyclesFunctions (/srv/app/node_modules/strapi/lib/Strapi.js:444:33)
at Strapi.load (/srv/app/node_modules/strapi/lib/Strapi.js:379:16)
at async Strapi.start (/srv/app/node_modules/strapi/lib/Strapi.js:196:9)
必须删除node_modules
并重新安装。Strapi镜像仅在node_modules
文件夹缺失时安装节点模块。因此,如果您以后添加了任何依赖,该依赖将不会自动安装。