The error Couldn't find a package.json file in “D:\\hadoop\hadoop-2.7.7\\sbin” occurred during the installation of hadoop under windows

The reason for this is that there was a command yarn with the same name in the system when node.js was installed before, so it is necessary to specify the yarn path when running hadoop yarn. The solution is to open the start-yarn.cmd file and modify its yarn running code as :

        1. Change to the bin directory

if not defined HADOOP_BIN_PATH ( 
  set HADOOP_BIN_PATH=%HADOOP_HOME%\bin
)

            2. Modify

@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 

Guess you like

Origin blog.csdn.net/2201_75630288/article/details/131263844