注意事项
1、当选择将网页部署到flash里,编译会出现如下错误
CMake Error at main/CMakeLists.txt:10 (message):
G:/esp32/restful_server/main/../front/web-demo/dist doesn't exit. Please
run 'npm run build' in G:/esp32/restful_server/main/../front/web-demo
2、解决办法,安装nodejs。nodejs集成了npm
- 下载地址:https://nodejs.org/en/download/
- 如果电脑是win7建议安装早期版本,node-v11.15.0-x64.msi经测试该版本可用,下载地址:https://nodejs.org/en/download/releases/
3、运行npm
打开cmd窗口,运行npm -v 显示出版本号,则说明安装成功
G:\esp32\restful_server\front\web-demo>npm -v
7.19.0
4、在front\web-demo文件夹运行 npm run build,发现报错
经查找是,缺少vue组件
G:\esp32\restful_server\front\web-demo>npm run build
> web-demo@0.1.0 build
> vue-cli-service build
'vue-cli-service' is not recognized as an internal or external command,
operable program or batch file.
5、安装vue组件,front\web-demo下执行npm install,等待安装完成,需要一段时间
6、再执行npm run build
7、执行完成后,会生成dist文件夹