【发布时间】:2021-03-09 05:13:31
【问题描述】:
我想在运行 Node JS 应用程序之前运行 NVM 命令。但是当我想执行source命令时,出现如下错误:
package.json 文件内:
{
"scripts": {
"prestart": "source $NVM_DIR/nvm.sh; nvm use 14.15.1"
},
}
运行yarn run prestart命令后的输出:
yarn run v1.22.5
$ source $NVM_DIR/nvm.sh; nvm use 14.15.1
/bin/sh: 1: source: not found
/bin/sh: 1: nvm: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我该怎么办?尽管 source 和 nvm 命令在 Yarn 之外运行良好。
【问题讨论】:
标签: node.js linux yarnpkg package.json nvm