我遇到了ebextension配置文件并出现了问题,尽管从服务器终端运行npm命令时我仍然能够访问npm,但我的服务器却找不到npm。这可能与配置文件尝试查找npm的位置有关吗?下面提供了错误和我的ebextension配置文件。
Running 4 of 5 actions: EbExtensionPostBuild...
Command execution failed: Activity failed. (ElasticBeanstalk::ActivityFatalError)
caused by: /bin/sh: npm: command not found
{"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"/bin/sh: npm: command not found. \ncontainer_command 01_webpack_build in .ebextensions/01_npm_build_start.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI","returncode":127,"events":[]}]}
01_npm_build_start.config :
container_commands:
01_webpack_build:
command: "npm run build"
02_run_node:
command: "npm start"
package.json:
"scripts": {
"start": "node app.js",
"build": "webpack",
}