盖茨比的环境变量“ env.cmd未找到”

时间:2020-01-08 20:57:25

标签: node.js npm environment-variables gatsby

尝试使用Gatsby运行env.cmd,但我得到export PATH=$HOME/bin:/usr/local/bin:**$HOME/.npm/bin**:$PATH。我确实已经安装了软件包。我尝试删除sh: env-cmd not found并运行.node-modules,但仍然遇到相同的错误。

gatsby-config.js:

npm install

端子:

{
...
  "scripts": {
    "build": "gatsby build",
    "develop": "env-cmd --file .env.development --fallback gatsby develop",
    "format": "prettier --write \"**/*.{js,jsx,json,md}\"",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "clean": "gatsby clean",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
  },
  "dependencies": {
    "gatsby": "^2.18.12",
    "gatsby-plugin-sass": "^2.1.26",
    "node-sass": "^4.13.0",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "typescript": "^3.7.4"
  },
  "devDependencies": {
    "env-cmd": "^8.0.2",
    "prettier": "^1.19.1"
  },
...
}

更新 对于遇到相同问题的其他人,这是我发现对我有用的解决方案:https://stackoverflow.com/a/56367980/10225590

0 个答案:

没有答案