OpenHarmony开发者论坛

标题: ohpm在ubuntu上安装后,提示ERROR: ohpm has not been initialized yet. Execute the init script to initialize it first [打印本页]

作者: 18025342273    时间: 2024-1-31 11:36
标题: ohpm在ubuntu上安装后,提示ERROR: ohpm has not been initialized yet. Execute the init script to initialize it first
[md]参照https://developer.harmonyos.com/ ... 0000001490235312-V3链接操作,下载linux版本ohpm,然后解压进入oh-command-line-tools/ohpm/bin目录./init运行结果如下
![image.png](https://forums-obs.openharmony.c ... c7qh79zl7qcz7cd.png "image.png")

是不是ubuntu不能安装ohpm
[/md]
作者: 马迪    时间: 2024-2-1 11:59
在 ~/Document/oh-command-line-tools/ohpm/bin/ 下执行 node pm-cli.js 查看详细报错信息
作者: 18025342273    时间: 2024-2-1 16:37
回复 马迪:
  1. /home/hgt/Documents/oh-command-line-tools/ohpm/node_modules/readable-stream/lib/ours/util.js:5
  2. const Blob = globalThis.Blob || bufferModule.Blob
  3.              ^

  4. ReferenceError: globalThis is not defined
  5.     at Object.<anonymous> (/home/hgt/Documents/oh-command-line-tools/ohpm/node_modules/readable-stream/lib/ours/util.js:5:14)
  6.     at Module._compile (internal/modules/cjs/loader.js:778:30)
  7.     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
  8.     at Module.load (internal/modules/cjs/loader.js:653:32)
  9.     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
  10.     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
  11.     at Module.require (internal/modules/cjs/loader.js:692:17)
  12.     at require (internal/modules/cjs/helpers.js:25:18)
  13.     at Object.<anonymous> (/home/hgt/Documents/oh-command-line-tools/ohpm/node_modules/readable-stream/lib/stream.js:31:5)
  14.     at Module._compile (internal/modules/cjs/loader.js:778:30)
复制代码

作者: 马迪    时间: 2024-2-4 09:21
更新一下nodejs版本到node18及以上




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5