Closed melgk closed 6 years ago
Happens with NodeJS 6 & NPM 3, as well as with NodeJS 8 & Yarn 1.6. However NPM 5.6 with NodeJS 8 seems to work fine.
Not sure if related, but for both NPM 3 & Yarn 1.6 I get warning
warning " > serverless-plugin-split-stacks@1.5.2" has unmet peer dependency "serverless@1".
Don't have time to investigate this more now, but hopefully this helps to narrow down the issue & probably help you to fix your deployment.
The problem is that the file no longer exist. Requiring 'deeply' in to other packages is an anti-pattern and it needs to be removed.
You should do npm link serverless
or install serverless as your devDependencies package
Should be fixed in 1.5.3, please let me know if it's not. I removed the deep-require.
it's now working, thank you very much
I am using aws codepipeline (and codebuild) to do serverless deployment.
partial serverless.yml:
custom: webpackIncludeModules: true test: node_env: test prod: node_env: prod custom: splitStacks: perFunction: false perType: true
provider: name: aws environment: NODE_ENV: ${self:custom.${opt:stage}.node_env} runtime: nodejs6.10 region: ap-southeast-2 vpc: securityGroupIds: ${file(vpc-config-${opt:stage}.js):securityGroups} subnetIds: ${file(vpc-config-${opt:stage}.js):subnets}
iamRoleStatements:
plugins:
When I run serverless deploy, this is the partial buildspec.yml
env: variables: NODE_ENV: prod
phases: install: commands:
(The stage prod is used only to define the security group and subnet for the aws environment.)
I got this error: Cannot find module 'serverless/lib/plugins/aws/lib/naming'
Stack trace: Error: Cannot find module 'serverless/lib/plugins/aws/lib/naming' at Function.Module._resolveFilename (module.js:440:15) at Function.Module._load (module.js:388:25) at Module.require (module.js:468:17) at require (internal/module.js:20:19) at Object. (/codebuild/output/src731592243/src/node_modules/serverless-plugin-split-stacks/lib/migration-strategy/per-function.js:3:21)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/codebuild/output/src731592243/src/node_modules/serverless-plugin-split-stacks/lib/migrate-new-resources.js:7:21)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/codebuild/output/src731592243/src/node_modules/serverless-plugin-split-stacks/split-stacks.js:7:29)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at plugins.forEach.error (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:90:24)
at Array.forEach (native)
at PluginManager.loadPlugins (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:88:13)
at PluginManager.loadServicePlugins (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:142:10)
at PluginManager.loadAllPlugins (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:84:10)
at service.load.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:67:28)
From previous event:
at runCallback (timers.js:570:20)
at tryOnImmediate (timers.js:550:5)
at processImmediate [as _immediateCallback] (timers.js:529:5)
From previous event:
at __dirname (/usr/local/lib/node_modules/serverless/bin/serverless:28:46)
at Object. (/usr/local/lib/node_modules/serverless/bin/serverless:46:4)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
at bootstrap_node.js:467:3
Environment information: OS: linux Node Version: 6.3.1 Serverless Version: 1.27.2
Any help would be much appreciated.