mthenw / serverless-go-plugin

⚡️ Serverless Framework plugin that compiles Go functions on the fly. Sponsored by https://cloudash.dev
https://cloudash.dev
MIT License
103 stars 17 forks source link

Error: Cannot find module 'glob' #51

Open goncaloneto13 opened 7 months ago

goncaloneto13 commented 7 months ago

serverless deploy --verbose Environment: linux, node 20.12.1, framework 3.38.0, plugin 7.2.3, SDK 4.5.1 Docs: docs.serverless.com Support: forum.serverless.com Bugs: github.com/serverless/serverless/issues Error: Error: Cannot find module 'glob' Require stack:

  • /opt/atlassian/pipelines/agent/build/node_modules/serverless-go-plugin/index.js
  • /usr/local/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js
  • /usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js
  • /usr/local/lib/node_modules/serverless/lib/serverless.js
  • /usr/local/lib/node_modules/serverless/scripts/serverless.js
  • /usr/local/lib/node_modules/serverless/bin/serverless.js at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15) at Module._load (node:internal/modules/cjs/loader:984:27) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:179:18) at Object. (/opt/atlassian/pipelines/agent/build/node_modules/serverless-go-plugin/index.js:10:14) at Module._compile (node:internal/modules/cjs/loader:1369:14) at Module._extensions..js (node:internal/modules/cjs/loader:1427:10) at Module.load (node:internal/modules/cjs/loader:1206:32) at Module._load (node:internal/modules/cjs/loader:1022:12) at Module.require (node:internal/modules/cjs/loader:1231:19) at require (node:internal/modules/helpers:179:18) at module.exports (/usr/local/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js:5:12) at PluginManager.requireServicePlugin (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:171:14) at PluginManager.resolveServicePlugins (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:198:29) at PluginManager.loadAllPlugins (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:136:47) at Serverless.init (/usr/local/lib/node_modules/serverless/lib/serverless.js:146:30) at async /usr/local/lib/node_modules/serverless/scripts/serverless.js:601:7
dharada1 commented 7 months ago

As a workaround, installing glob manually by npm i glob before serverless deploy worked for me. (My use-case is inside github actions. Just added it on run: section )