desec-stack icon indicating copy to clipboard operation
desec-stack copied to clipboard

webapp's npm install fails

Open nils-wisiol opened this issue 4 years ago • 3 comments

If there is no package-lock.json present and npm version is 7.4.3, npm install fails.

Providing a package-lock.json file or using npm 6.14.11 solves (or circumvents) the problem.

In the worst case, this could break the webapp during deployment.

Here is a backup package-lock.json that enables npm install with npm version 7.4.3. package-lock.json.gz

nils-wisiol avatar Feb 17 '21 10:02 nils-wisiol

It's good practice to check in the package-lock.json into git. This allows to install with npm ci, and guarantees you get the same packages as e.g. were used for testing. So, please provide a package-lock.json.

unuseless avatar Jul 11 '21 18:07 unuseless

@unuseless, would you be able to provide a PR for this? I'm unfamiliar with the details of npm best practice, your help would be most welcome

nils-wisiol avatar Jul 12 '21 11:07 nils-wisiol

@nils-wisiol At the moment I'm unable to provide a PR, but I can give you the commands here:

# to make sure you have a recent package-lock.json
npm install
# check if your packages are updated
npm outdated
# maybe update
npm update
# add package-lock.json to git, maybe remove from .gitignore?
git add .
git commit -m "added package-lock.json"
# edit README

Add to the README: To install the dependencies for the webapp, use npm ci.

unuseless avatar Jul 12 '21 11:07 unuseless

fixed in #611

peterthomassen avatar Oct 05 '22 23:10 peterthomassen