sh:1:顺风:部署到heroku时找不到

时间:2019-02-20 20:32:09

标签: javascript node.js heroku tailwind-css

package.json

  "devDependencies": {
    "tailwindcss": "^0.7.4"
  },
"scripts": {
    "tailwind:css": "tailwind build src/css/tailwind.src.css -c tailwind.js -o src/css/tailwind.css",
    "start": "npm run tailwind:css && react-scripts start",
    "build": "npm run tailwind:css && react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },

错误:

sh: 1: tailwind: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! client@0.1.0 tailwind:css: `tailwind build src/css/tailwind.src.css -c tailwind.js -o src/css/tailwind.css`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the client@0.1.0 tailwind:css script.

1 个答案:

答案 0 :(得分:1)

尽管(以我的经验),尽管一些heroku部署似乎以某种方式摆脱了devDependencies中的不利因素,但将其移至dependencies确实可以解决此问题。

这不仅会影响顺风,因此您可能需要跨顺风移动更多内容才能使构建正常工作。