【发布时间】:2015-09-09 00:43:52
【问题描述】:
我有这些:
一个shell可执行文件:
function print() {
echo 1
}
package.json` 文件
{
"name": "tests",
"scripts": {
"test": "./shell.sh"
}
}
当我在一台 linux 机器上运行 npm test 时,我得到了这个错误
> tests@ test /home/xxxx/test
> ./shell.sh
./shell.sh: 1: ./shell.sh: Syntax error: "(" unexpected
npm ERR! Test failed. See above for more details.
为什么会这样?有人有一些见识吗?我完全不解。
【问题讨论】:
-
我没有在脚本中看到 shebang。有没有发布的?