链接npm脚本

时间:2019-04-23 18:22:35

标签: heroku npm yarnpkg npm-scripts

在package.json scripts:中,我有

...
"prestart": "cd client && yarn build",
"start": "node server",
"heroku-postbuild": "cd client && yarn build"
},

在本地,我想在运行节点服务器之前引用"heroku-postbuild"中的"prestart"在子文件夹中构建Webpack:

...
"prestart": "\"yarn run heroku-postbuild\"",
"start": "node server",
"heroku-postbuild": "cd client && yarn build"
},

yarn start返回

yarn run v1.3.2
$ "yarn run heroku-postbuild"
/bin/sh: 1: yarn run heroku-postbuild: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

"heroku-postbuild"仅保留用于heroku吗?

0 个答案:

没有答案