could not find commit hash for HEAD报错
按照openlayers官网上给出的快速入门操作,尝试安装openlayers库时候发现无法安装。
快速入门操作:
npm create ol-app my-app
cd my-app
npm start
在文件夹的cmd输入npm create ol-app my-app时,一直显示:
E:\webgis\openlayers\task_01>npm create ol-app my-app
npx
create-ol-app my-app
could not find commit hash for HEAD
npm error code 1
npm error path E:\webgis\openlayers\task_01
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c create-ol-app my-app
npm error A complete log of this run can be found in: C:\Users\ASUS\AppData\Local\npm-cache_logs\2025-09-18T01_12_04_284Z-debug-0.log
在网上搜寻了很多,有人说是git安装错误,也有说网络不可以的。我就把git重新安装重新下载了很多次,但是没有用;网络方面使用了梯子,但不管是使用还是没使用,始终说找不到哈希表,
附上git和node的版本:
E:\webgis\openlayers\task_01>git -v
git version 2.51.0.windows.1
E:\webgis\openlayers\task_01>node -v
v22.19.0
问了chatgpt等ai,使用了degit等工具,还是无法解决,感觉快不行了,求解答,谢谢你们