serverless / serverless/serverless
Questions about installing Serverless Framework V4 binaries and scripts
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.9k
- Forks
- 5.7k
- Avg merge
- 10h 7m
- Merged PRs (30d)
- 57
Description
Issue description
I have several questions about the binary files that binary.js installs when I run the serverless (sls) command, and the JavaScript files (such as sf-core.js) that the binary files appear to install under $HOME/.serverless/releases/x.y.z/.
Q.1 Under the following conditions, if I have already run the serverless (sls) command once and installed a binary file named serverless-<OS_TYPE>-<OS_CPU_ARCHITECTURE>-<SERVERLESS_BINARY_VERSION> (e.g. serverless-linux-amd64-0.0.2) locally using run.js and binary.js, is it guaranteed that it will not be overwritten the second time onwards? (I read binary.js and think the specifications are as written above, but I just want to confirm if my understanding is correct.)
- Condition 1: Always run on the same OS type and OS arch (e.g.
linux-amd64) - Condition 2: The version of the Serverless Framework is completely fixed in the frameworkVersion in serverless.yml (e.g.
frameworkVersion: 4.4.18)
Q.2 What does the binary file serverless-<os.type>-<os.arch>- (e.g. serverless-linux-amd64-0.0.2) do? (I assume that this binary file reads the frameworkVersion: x.y.z specified in serverless.yml, if any, and then downloads the corresponding version of the Serverless Framework JavaScript files (such as sf-core.js) from the server you manage, and installs it under $HOME/.serverless/releases/x.y.z/. But is that correct? Does this binary file do anything else?)
Q.3 Is the source code for serverless-<os.type>-<os.arch>- available for viewing?
Q.4 Will the contents under the $HOME/.serverless/releases/x.y.z/ will be exactly the same as long as the frameworkVersion: x.y.z specified in serverless.yml does not change?)
Q.5 By default, JavaScript files (such as sf-core.js) seem to be installed in $HOME/.serverless/releases/x.y.z/, but can I change this path to a path of my choice? For example, can I change it to the same directory as binary.js as follows?
/<PATH>/<TO>/<MY_SERVERLESS_PROJECT>/node_modules/serverless
├── README.md
├── binary.js
├── node_modules
│ └── .bin
│ └── serverless-linux-amd64-0.0.2
├── package.json
├── postInstall.js
├── .serverless
│ └── releases
│ └── 4.4.18
└── run.js
- Related issue: https://github.com/serverless/serverless/issues/12692
Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the mentioned binary.js, run.js, and postInstall.js files, then compare their behavior with related issue #12692. Trace how the Serverless Framework version and release path are handled. Done means providing authoritative answers to the five installation and source-availability questions, or documenting any supported configuration limits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100