電子產(chǎn)業(yè)一站式賦能平臺

PCB聯(lián)盟網(wǎng)

搜索
查看: 2115|回復: 0
收起左側(cè)

【HarmonyOS HiSpark IPC試用】用hpm獲取源碼方式環(huán)境--hpm安裝

[復制鏈接]

2607

主題

2607

帖子

7472

積分

高級會員

Rank: 5Rank: 5

積分
7472
跳轉(zhuǎn)到指定樓層
樓主
發(fā)表于 2021-2-1 09:56:43 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
【HarmonyOS HiSpark IPC試用】用hpm獲取源碼方式環(huán)境--hpm安裝,   

昨天編譯出錯,可能gitee下載源碼有問題,今天試試用hpm獲取源碼 安裝Node.js。



打開CMD,執(zhí)行以下命令: 安裝完成后執(zhí)行如下命令,顯示hpm版本,即安裝成功。 如果升級hpm的版本,請執(zhí)行如下命令:

查看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: 看來權(quán)限不夠,加sudo [sudo] password for fan://輸入密碼 + n@7.0.1 安裝最近穩(wěn)定版本,是v14.15.4,應(yīng)該夠本了吧   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 已經(jīng)指向新目錄,我就不管它了 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:
回復

使用道具 舉報

發(fā)表回復

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

關(guān)閉

站長推薦上一條 /1 下一條


聯(lián)系客服 關(guān)注微信 下載APP 返回頂部 返回列表