安装nodejs依赖

完成上面的js文件编写后,接下来就是在xiaowei-app目录中执行npm install安装依赖模块

npm install

这样它就会根据我们之前的package.json的设置安装相关模块

如果出现以下错误

gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
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 - not found
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 **************************************************************
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 **************************************************************

则需要先安装Visual Studio和node-gyp

先以管理员的身份打开CMD,然后执行命令安装Visual Studio

npm install -g node-gyp
npm install --global --production windows-build-tools

最后可能会提示这个提醒,这个不需要管它

npm WARN [email protected] No repository field.

本文由小韦云原创,转载请注明出处:https://www.bctos.cn/doc/4/1826,否则追究其法律责任

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章