Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
why does serverless framework not include package.json for aws-nodejs template

When trying to create a new serverless project using the cli

sls create -t aws-nodejs -p testfolder

Serverless framework creates:

  1. handler.js
  2. serverless.yml
  3. .gitignore

Why doesn't a package.json be included and also why is only a package-lock.json file created / generated when installing npm packages e.g lodash

Running the following:

npm install --save lodash

only creates a node_module folder and a package-lock.json file. There is no package.json file. Trying to understand why as this is not the case with:

sls create -t aws-nodejs-typescript -p test
nvm: 0.39.1
node: v14.19.3
npm: 6.14.17

sls

Framework Core: 3.21.0
Plugin: 6.2.2
SDK: 4.3.2

Thank you for taking the time to read this.

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

Yeah, the framework probably could create a package.json for you when you create a new nodejs project. However, there are several cases where a user wouldn't need any node modules at all, so it makes sense to not provide a package.json file unless the user installs other dependencies.

The typescript template is a bit different, because the Serverless Framework has a plugin system which is based on npm, so adding a plugin will require a package.json file to track the dependency.

So when you run sls create -t aws-nodejs-typescript, it automatically generates a serverless.yml file which includes the serverless-esbuild plugin, and thus creates a package.json file tracking it. The typescript template also includes a bunch of dev dependencies, which also are tracked via npm.

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda