windows下hadoop安装时启动yarn时出现error Couldn't find a package.json file问题
yarn run v1.22.0
error Couldn't find a package.json file in "D:\\hadoop\hadoop-2.7.7\\sbin"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
出现这个原因是由于之前安装node.js时系统里有重名命令yarn,所以在运行hadoop的yarn的时候需要制定其yarn路径,解决办法是打开start-yarn.cmd文件,修改其yarn运行代码为:
@rem start resourceManager
start "Apache Hadoop Distribution" %HADOOP_BIN_PATH%\yarn resourcemanager
@rem start nodeManager
start "Apache Hadoop Distribution" %HADOOP_BIN_PATH%\yarn nodemanager
@rem start proxyserver
@rem start "Apache Hadoop Distribution" %HADOOP_BIN_PATH%\yarn
其中%HADOOP_BIN_PATH%为hadoop按照目录下的bin目录位置