簡體   English   中英

為什么運行這個 env-cmd 命令會給我這個錯誤?

[英]Why running this env-cmd command is giving me this error?

我正在嘗試在我的項目中配置本地環境。

我正在運行npm run dev命令。

這是我的 package.json

在此處輸入圖像描述

如您所見,我正在使用env-cmd package。

但是當我運行命令 window 給我這個錯誤。

This file does not have an app associated with it for performing this action...

在此處輸入圖像描述

為什么我會收到此錯誤?

根據這篇文章:

https://medium.com/@rishi.vedpathak/react-environment-specific-builds-using-env-with-cra-and-env-cmd-5960a1253fe6

"scripts": {
    "start": "react-scripts start",
    "start:staging": "env-cmd -f .env.staging react-scripts start",
    "start:prod": "env-cmd -f .env.production react-scripts start",
    "build:staging": "env-cmd -f .env.staging react-scripts build",
    "build:prod": "env-cmd -f .env.production react-scripts build"
}

您缺少-f參數

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM