1.下载并安装 Visual Studio Code
2.安装node
参考win10下安装npm&cnpm步骤 - dalyday - 博客园
2.1分别输入node -v,npm -v检查是否完成
2.2配置npm的全局模块的存放路径以及cache的路径(替换成自己的路径)
npm config set prefix "F:\cache\nodeCache\global"
npm config set cache "F:\cache\nodeCache\cache"
2.3##设置淘宝镜像
##npm config set registry http://registry.cnpmjs.org
2.4安装模块测试
npm install express -g
2.5##通过npman下载安装cnpm
##npm install -g cnpm -registry=https://registry.npm.taobao.org
2.6输入cnpm -v,不是内部命令的话,新增node_global的path环境配置
F:\cache\nodeCache\global
2.7.输入cnpm -v,成功后会显示版本信息
2.8:报错(参考:首次使用electron-vue踩过的坑_lianlin21212411的博客-CSDN博客)
msvs_version was set from command line or npm config
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2019
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - found in "C:\Program Files (x86)\Microsoft Visual Studio 14.0"
gyp ERR! find VS - could not find MSBuild in registry for this version
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS valid versions for msvs_version:
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
我使用的是VS Code 1.62.0,难道要换成最新版的Visual Studio?从网上查询得知需要安装windows-build-tools,需要注意的是,必须是以管理员身份来进行安装,因此在打开cmd时要以管理员身份打开。
npm install --g --production windows-build-tools
3.sap新建项目(参考掘金)
3.1添加sap插件:
扩展-->
3.2新建项目:F1-->open application generator
3.3运行
第一次运行前,进入项目目录,npm install
运行命令:npm start
4.SAP apis