Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: improve cli installing (#3538)

Bogdan Chadkin2c270914f270
diff --git a/apps/builder/app/builder/features/topbar/publish.tsx b/apps/builder/app/builder/features/topbar/publish.tsx
index e8d2cfa162..5d2840baea 100644
--- a/apps/builder/app/builder/features/topbar/publish.tsx
+++ b/apps/builder/app/builder/features/topbar/publish.tsx
@@ -516,12 +516,12 @@ const Content = (props: {
const deployTargets = {
vercel: {
- command: "npx vercel",
+ command: "npx vercel@latest",
docs: "https://vercel.com/docs/cli",
},
netlify: {
command: `
-npx netlify-cli login
+npx netlify-cli@latest login
npx netlify-cli sites:create
npx netlify-cli build
npx netlify-cli deploy`,
@@ -535,7 +535,7 @@ const isDeployTargets = (value: string): value is DeployTargets =>
Object.keys(deployTargets).includes(value);
const ExportContent = () => {
- const npxCommand = "npx webstudio";
+ const npxCommand = "npx webstudio@latest";
const [deployTarget, setDeployTarget] = useState<DeployTargets>("vercel");
return (
diff --git a/packages/cli/.npmignore b/packages/cli/.npmignore
deleted file mode 100644
index 3c12f02e9a..0000000000
--- a/packages/cli/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# Explicitly include .npmrc https://docs.npmjs.com/cli/v9/using-npm/developers#keeping-files-out-of-your-package
-!.npmrc
diff --git a/packages/cli/README.md b/packages/cli/README.md
index c6f0ff7858..b7619352f9 100644
--- a/packages/cli/README.md
+++ b/packages/cli/README.md
@@ -35,7 +35,7 @@ To get started with the Webstudio CLI:
1. Download and install the CLI using the following command:
```bash
- npm install -g webstudio
+ npm install -g webstudio@latest
```
1. Confirm the installation by checking the CLI version:
diff --git a/packages/cli/package.json b/packages/cli/package.json
index d036eed369..318af8318f 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -29,6 +29,9 @@
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
},
"license": "AGPL-3.0-or-later",
+ "engines": {
+ "node": ">=20.12"
+ },
"dependencies": {
"@clack/prompts": "^0.7.0",
"@webstudio-is/http-client": "workspace:*",
diff --git a/packages/cli/src/prebuild.ts b/packages/cli/src/prebuild.ts
index b389d7bf4d..68fb3b5d35 100644
--- a/packages/cli/src/prebuild.ts
+++ b/packages/cli/src/prebuild.ts
@@ -251,6 +251,9 @@ export const prebuild = async (options: {
await copyTemplates();
+ // force npm to install with not matching peer dependencies
+ await writeFile(join(cwd(), ".npmrc"), "force=true");
+
for (const template of options.template) {
// default template is already applied no need to copy twice
if (template === "vanilla") {
diff --git a/packages/cli/templates/defaults/.npmrc b/packages/cli/templates/defaults/.npmrc
deleted file mode 100644
index 5e3cde50ab..0000000000
--- a/packages/cli/templates/defaults/.npmrc
+++ /dev/null
@@ -1 +0,0 @@
-force=true