Comments (6)
You need to run npm ci
in the main directory. Once that is done you need to go to the apps/web folder, and run the build command.
Check the Dockerfile which does a change of directory after the npm ci
command.
from bw_web_builds.
You need to run
npm ci
in the main directory. Once that is done you need to go to the apps/web folder, and run the build command.Check the Dockerfile which does a change of directory after the
npm ci
command.
Hi thank you for your time.
In my Dockerfile, before npm ci
WORKDIR is /vault.
Next, after npm audit fix
it switches in WORKDIR /vault/apps/web.
For the moment i fixed it using npm install
instead of npm ci
that let the build overwrite package-lock.json, building successfully.
Web vault seems working fine, but i don't know if it's a good practice.
Thank you again
from bw_web_builds.
Hi,
there's another problem trying to build by 'npm old fashion way'.
The script i run doesn't work with new repository arrangement.
#!/bin/bash
echo "Set version vX.YZ.K. Current v2022.6.0"
read VS
rm -rf npm_log.txt web-vault vw-web-vault.zip ${VS}.patch
git clone https://github.com/bitwarden/clients.git web-vault
wget https://raw.githubusercontent.com/dani-garcia/bw_web_builds/master/patches/${VS}.patch
cat ${VS}.patch vw-mod_${VS}.patch > web-vault/${VS}.patch
cd web-vault
git -c advice.detachedHead=false checkout "web-${VS}"
git apply -v --check --ignore-space-change --reject ${VS}.patch
while [[ -z "$COMP" && "$COMP" != "y" && "$COMP" != "n" ]]
do
echo "Patch check has finished, do you wanna build? (y,n)"
read COMP
if [ "$COMP" = y ]; then
git apply -v --ignore-space-change --reject ${VS}.patch 2>&1 | tee ../npm_log.txt
#npm ci 2>&1 | tee -a ../npm_log.txt
npm install 2>&1 | tee -a ../npm_log.txt
npm audit fix | tee -a ../npm_log.txt || true
cd apps/web
npm run dist:oss:selfhost 2>&1 | tee -a ../npm_log.txt
mv build vw-web-vault
zip -qr ../vw-web-vault-${VS}.zip vw-web-vault/
elif [ "$COMP" = n ]; then
exit 1
fi
done
My script seems to accord with the path order to run npm directives: (npm install
and npm audit fix
in the "root" web-vault
directory and npm run dist:oss:selfhost
in web-vault/apps/web
. Anyway i get the errors below: it looks like the dependecies installed in the repository's root don't work.
The same script has always worked succesfully until v2022.5.2 bitwarden repository, before merging all clients projects. What I'm doing wrong?
> @bitwarden/[email protected] dist:oss:selfhost
> npm run build:oss:selfhost:prod
> @bitwarden/[email protected] build:oss:selfhost:prod
> cross-env ENV=selfhosted NODE_ENV=production npm run build:oss
sh: 1: cross-env: not found
Thank you
from bw_web_builds.
@bitwarden/[email protected] dist:oss:selfhost
npm run build:oss:selfhost:prod@bitwarden/[email protected] build:oss:selfhost:prod
cross-env ENV=selfhosted NODE_ENV=production npm run build:osssh: 1: cross-env: not found
Not sure where that is coming from. I don't seem to have that specific issue at all.
Not via the docker build or the build using the host it self.
Also, i would suggest to keep using npm ci
instead of npm install
, since npm ci
doesn't modify versions, and should produce more reliable builds because of this. It is also important to try and use the exact same versions as Bitwarden does for there CI builds, so nodejs v16.x and npm v8.11 (See: https://github.com/bitwarden/clients/runs/7290756644?check_suite_focus=true#step:4:14 ). Maybe a minor version difference will not matter that much, but i know major versions do cause issue, like with the CLI, it will generate a broken build when complied with v18 for example.
from bw_web_builds.
@bitwarden/[email protected] dist:oss:selfhost
npm run build:oss:selfhost:prod@bitwarden/[email protected] build:oss:selfhost:prod
cross-env ENV=selfhosted NODE_ENV=production npm run build:osssh: 1: cross-env: not found
Not sure where that is coming from. I don't seem to have that specific issue at all. Not via the docker build or the build using the host it self.
Also, i would suggest to keep using
npm ci
instead ofnpm install
, sincenpm ci
doesn't modify versions, and should produce more reliable builds because of this. It is also important to try and use the exact same versions as Bitwarden does for there CI builds, so nodejs v16.x and npm v8.11 (See: https://github.com/bitwarden/clients/runs/7290756644?check_suite_focus=true#step:4:14 ). Maybe a minor version difference will not matter that much, but i know major versions do cause issue, like with the CLI, it will generate a broken build when complied with v18 for example.
Thank you,
the link you shared to check npm version is very useful.
Anyway, about npm ci
i really need to edit package.json in the repo's main directory to add dependencies that let me handle cookies in my web vault. If use npm ci
instead of npm install
i get error and the docker build stops itself:
npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
and i don't know how to get rid of it.
It didn't happen when package.json was in the same directory of web-vault, that is before v2022.6.0 when each client had its own repo project.
from bw_web_builds.
Ah, in that case, since you change stuff, then i think you need to use npm install
. And if that works, the i would use that.
For other how-to's i suggest to check the clients repo. That is a bit out of the range for this repo.
from bw_web_builds.
Related Issues (20)
- GPG key used for releases package is expired HOT 2
- problem with creating new accounts in version 2022.11.1 HOT 3
- Link to 2FA recovery might not work properly HOT 2
- AGPL? HOT 3
- Unable to build on macOS HOT 2
- something off with version number
- Diagnostic page web version check HOT 1
- Would you mind offer the resources to be in the correct tree structure? HOT 1
- Link to Vaultwarden Github repository in footer HOT 11
- build web-vault v2023.5.0 patch HOT 1
- Web vault loads Ukraine hymn HOT 6
- Wrong web-vault version in diagnostic admin panel HOT 2
- Master password: input is required HOT 4
- Considering update to node 18? HOT 9
- Rethinking the web-vault repository HOT 3
- during build: Unable to resolve reference $tailwindcss HOT 7
- Remove version display on the frontpage. HOT 2
- BUG: importing json HOT 2
- Applying the patched svg logos is a bit tricky for my downstream packaging HOT 3
- Current install instructions fail HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bw_web_builds.