From 4ba560e2a80ebdb0ce079a1fc5a0db04702f945c Mon Sep 17 00:00:00 2001 From: Thuc Pham <51660321+thucpn@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:43:53 +0700 Subject: [PATCH] Fix: npm script does not run in window machine (#283) --- templates/index.ts | 2 +- templates/types/streaming/nextjs/package.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/index.ts b/templates/index.ts index a1b9c46a..880af908 100644 --- a/templates/index.ts +++ b/templates/index.ts @@ -247,7 +247,7 @@ const installTSTemplate = async ({ // modify the dev script to use the custom api path packageJson.scripts = { ...packageJson.scripts, - dev: `NEXT_PUBLIC_CHAT_API=${customApiPath} next dev`, + dev: `cross-env NEXT_PUBLIC_CHAT_API=${customApiPath} next dev`, }; } diff --git a/templates/types/streaming/nextjs/package.json b/templates/types/streaming/nextjs/package.json index 3160e53c..2f23029d 100644 --- a/templates/types/streaming/nextjs/package.json +++ b/templates/types/streaming/nextjs/package.json @@ -37,6 +37,7 @@ "postcss": "^8.4.32", "tailwindcss": "^3.3.6", "typescript": "^5.3.2", - "@types/react-syntax-highlighter": "^15.5.11" + "@types/react-syntax-highlighter": "^15.5.11", + "cross-env": "^7.0.3" } -} \ No newline at end of file +} -- GitLab