:818
出错原因,npm版本问题,本来想降node版本,直接把node.exe换了,结果安装完cnpm,一直报错cnpm -v
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module ‘node:util’
Require stack:
- D:\program files\nodejs\node_global\node_modules\cnpm\bin\cnpm
[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:667:27)[39m
[90m at Module.require (internal/modules/cjs/loader.js:887:19)[39m
[90m at require (internal/modules/cjs/helpers.js:74:18)[39m
at Object. (D:\program files\nodejs\node_global\node_modules\[4mcnpm[24m\bin\cnpm:3:15)
[90m at Module._compile (internal/modules/cjs/loader.js:999:30)[39m
[90m at Object.Module._extensions…js (internal/modules/cjs/loader.js:1027:10)[39m
[90m at Module.load (internal/modules/cjs/loader.js:863:32)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:708:14)[39m
[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)[39m {
code: [32m’MODULE_NOT_FOUND’[39m,
requireStack: [
[32m’D:\program files\nodejs\node_global\node_modules\cnpm\bin\cnpm’[39m
]
}
搞半天,是版本问题,又换回了之前的版本,好了