安裝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,否則追究其法律責任

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