ECharts--自定义构建ECharts坑点

时间:2024-04-04 12:02:34

ERROR 1 internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module ‘fs-extra’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (E:\workspace\ptj-lan\myProject01\node_modules\echarts\build\build.js:22:17)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

ERROR 2 npm ERR! Error while executing:
npm ERR! D:\download\Git\cmd\git.EXE ls-remote -h -t ssh://[email protected]/babel/helper-module-transforms.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR! F:\nodejs\node_cache_logs\2019-08-20T12_38_52_765Z-debug.log
ECharts--自定义构建ECharts坑点
在实验这一步的时候,我得到了如下错误:
ECharts--自定义构建ECharts坑点
经过查阅资料发现,是因为没有安装‘fs-extra’这个模块
使用命令 npm install -g fs-extra进行安装
ECharts--自定义构建ECharts坑点
这么看,好像是解决问题了,然而
ECharts--自定义构建ECharts坑点
ECharts--自定义构建ECharts坑点
在执行命令时,又发生了如上问题:
查阅资料发现,可能正确的姿势是这样?
ECharts--自定义构建ECharts坑点
但是好像似乎不行?
经过查阅资料发现可能npm的版本不是最新的,所以更新一下npm的版本,然后再进行测试
ECharts--自定义构建ECharts坑点
似乎可以,只是这里又要安装新的模块
ECharts--自定义构建ECharts坑点
一路安装,一路测试
ECharts--自定义构建ECharts坑点
ECharts--自定义构建ECharts坑点
很好,重头戏来了
ECharts--自定义构建ECharts坑点
这个错误据说是npm挂了,要用nrm,具体如下
ECharts--自定义构建ECharts坑点
继续安装模块
ECharts--自定义构建ECharts坑点
可歌可泣,大功告成
感谢某大佬指点小弟安装nrm,OTZ

描述NRM的文章