Node.js sh:1:未找到节点(npm错误!yorkie@1.0.3安装)

Node.js sh:1:未找到节点(npm错误!yorkie@1.0.3安装),node.js,bash,ubuntu,Node.js,Bash,Ubuntu,我有一个小的bash脚本,可以下载和提取node.js,然后尝试运行npm安装是的,我读过关于nvm的文章,但想了解这个问题 build.sh 当我运行上述脚本时,我安装了部分依赖项,但在某些情况下失败,原因是: v10.0.0 5.6.0 > yorkie@1.0.3 install /home/user/repos/webapp/webapp-frontend-vue-cli/node_modules/yorkie > node bin/install.js sh: 1: n

我有一个小的bash脚本,可以下载和提取node.js,然后尝试运行npm安装是的,我读过关于nvm的文章,但想了解这个问题

build.sh

当我运行上述脚本时,我安装了部分依赖项,但在某些情况下失败,原因是:

v10.0.0
5.6.0

> yorkie@1.0.3 install /home/user/repos/webapp/webapp-frontend-vue-cli/node_modules/yorkie
> node bin/install.js

sh: 1: node: not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! yorkie@1.0.3 install: `node bin/install.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the yorkie@1.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2019-12-17T15_48_53_166Z-debug.log
以及package.json文件:

任何关于错误的建议-npm和node都可以在运行脚本的当前shell中找到。

导出节点的路径不是绝对路径。换行

export NODE_PATH="${PWD}/${NODE_FOLDER}/bin"
别忘了在脚本的第一行添加一个shebang

#!/bin/bash

你确定它是node而不是nodejs吗?
export NODE_PATH="${PWD}/${NODE_FOLDER}/bin"
#!/bin/bash