nrm安裝報錯
下方為錯誤資訊
C:\Users\kefu>nrm --version
internal/validators.js:124
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
[TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:124:11)
at Object.join (path.js:375:7)
at Object.<anonymous> (C:\Users\kefu\AppData\Roaming\npm\node_modules\nrm\cli.js:17:20)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
] {
code: 'ERR_INVALID_ARG_TYPE'
}
解決方案
找到下方地址(見加粗部分,具體位置請參考報錯代碼的路徑)
C:\Users\kefu\AppData\Roaming\npm\node_modules\nrm\cli.js:17:20
注釋或者洗掉【cli.js】第十七行,修改為下方代碼
//const NRMRC = path.join(process.env.HOME, '.nrmrc'); (洗掉)
const NRMRC = path.join(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.nrmrc');
最后一步
我們在cmd中執行nrm --version,即可發現成功顯示版本號
C:\Users\kefu>nrm --version
1.2.1
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/261777.html
標籤:區塊鏈
上一篇:位元幣合約如何穩操勝券?
下一篇:Promise初體驗
