电子产业一站式赋能平台

PCB联盟网

搜索
查看: 2125|回复: 0
收起左侧

【HarmonyOS HiSpark IPC试用】用hpm获取源码方式环境--hpm安装

[复制链接]

2607

主题

2607

帖子

7472

积分

高级会员

Rank: 5Rank: 5

积分
7472
发表于 2021-2-1 09:56:43 | 显示全部楼层 |阅读模式
【HarmonyOS HiSpark IPC试用】用hpm获取源码方式环境--hpm安装,   

昨天编译出错,可能gitee下载源码有问题,今天试试用hpm获取源码 安装Node.js。



打开CMD,执行以下命令: 安装完成后执行如下命令,显示hpm版本,即安装成功。 如果升级hpm的版本,请执行如下命令:

查看node版本 v10.19.0 fan@FAN:~$ npm install -g n npm ERR! code EACCES npm ERR! path /usr/local/lib npm ERR! Error: EACCES: permission denied, access \“/usr/local/lib\“ npm ERR!   stack: npm ERR!   errno: -13, npm ERR!   syscall: \“access\“, npm ERR! npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! the command again as root/Administrator. npm ERR! A complete log of this run can be found in: 看来权限不够,加sudo [sudo] password for fan://输入密码 + n@7.0.1 安装最近稳定版本,是v14.15.4,应该够本了吧   installing : node-v14.15.4 mkdir: cannot create directory ‘/usr/local/n’: Permission denied   Error: sudo required (or change ownership, or define N_PREFIX) fan@FAN:~$ sudo n stable        mkdir : /usr/local/n/versions/node/14.15.4    instalLED : v14.15.4 (with npm 6.14.10) Note: the node command changed location and the old location may be remembered in your current shell.          new : /usr/local/bin/node        //新安装node目录 再查看node版本 v10.19.0 fan@FAN:~$ which node 已经指向新目录,我就不管它了 internal/modules/cjs/loader.js:883   ^ Error: Cannot find module \“semver\“        //报错没有semver - /usr/share/npm/lib/utils/unsupported.js     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)     at Module.require (internal/modules/cjs/loader.js:952:19)     at Object.<anonymous> (/usr/share/npm/lib/utils/unsupported.js:2:14)     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)     at Function.Module._load (internal/modules/cjs/loader.js:769:14)   code: \“MODULE_NOT_FOUND\“,     \“/usr/share/npm/lib/utils/unsupported.js\“, 报错没有semver  就安装 [sudo] password for fan: npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN fan No description npm WARN fan No README data

added 3 packages from 2 contributors in 8.69s

    │                                                                 │    │   Changelog: https://github.com/npm/cli/releases/tag/v6.14.11   │    │                                                                 │ 提示升级npm npm ERR! code EACCES npm ERR! path /usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/yargs-parser npm ERR! errno -13 npm ERR!  [OperationalError: EACCES: permission denied, rename \“/usr/local/lib/node_modules/.staging/npm-3e479054/node_modules/yargs-parser\“ -> \“/usr/local/lib/node_modules/.staging/yargs-parser-2ae220e0\“] { npm ERR!     errno: -13, npm ERR!     syscall: \“rename\“, npm ERR!     dest: \“/usr/local/lib/node_modules/.staging/yargs-parser-2ae220e0\“ npm ERR!   errno: -13, npm ERR!   syscall: \“rename\“, npm ERR!   dest: \“/usr/local/lib/node_modules/.staging/yargs-parser-2ae220e0\“ npm ERR! npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! the command again as root/Administrator. npm ERR! A complete log of this run can be found in: 升级也出错,尝试再安装semver npm WARN saveError ENOENT: no such file or directory, open \“/home/fan/package.json\“ npm WARN fan No description npm WARN fan No README data

updated 1 package in 0.924s fan@FAN:~$ sudo npm install -g @ohos/hpm-cli npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410 npm ERR! Unexpected end of JSON input while parsing near \“...sj1FJcyP6mhwDIXJUbk3P\“ npm ERR! A complete log of this run can be found in: 再次安装hpm,提示……Unexpected end of JSON input……,清理缓存 npm WARN using --force I sure hope you know what you are doing. fan@FAN:~$ sudo npm install -g @ohos/hpm-cli npm WARN deprecated @babel/polyfill@7.12.1:
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


联系客服 关注微信 下载APP 返回顶部 返回列表