最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

NPM相關(guān)命令之報(bào)錯(cuò)node-gyp...的解決方法

 更新時(shí)間:2022年09月05日 13:06:01   作者:班納  
node-gyp就是為node編譯c++擴(kuò)展的時(shí)候使用的編譯工具,下面這篇文章主要給大家介紹了關(guān)于NPM相關(guān)命令之報(bào)錯(cuò)node-gyp...的解決方法,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下

NPM 相關(guān)命令,報(bào)錯(cuò) node-gyp… 的解決方法

'node-gyp-build' is not recognized as an internal or external command, operable program or batch file.
npm ERR! gyp verb `which` failed Error: not found: python2

相關(guān)的異常信息

> node-gyp-build


                    errorOut='node-gyp-build' is not recognized as an internal or external command,
    operable program or batch file.
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! utf-8-validate@5.0.9 install: `node-gyp-build`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the utf-8-validate@5.0.9 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     D:\app\nodejs\npm-cache\_logs\2022-06-10T00_53_04_766Z-debug.log

                    command='D:\app\nodejs\node.exe' 'D:\app\nvm\v14.7.0\node_modules\npm\bin\npm-cli.js' rebuild utf-8-validate@5.0.9
                    workingDir=
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lx-music-desktop@1.22.0-beta pack:dir: `node build-config/pack.js && electron-builder --dir`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lx-music-desktop@1.22.0-beta pack:dir script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\app\nodejs\npm-cache\_logs\2022-06-10T00_53_04_842Z-debug.log

通用的解決方案

1. 在線安裝,適合擁有純凈 Windows 開發(fā)環(huán)境的用戶(沒有安裝過 Python, Visual Studio 等…)

# 全局設(shè)置淘寶鏡像(配置過的老鳥可忽略此步驟)
$ npm config set registry https://registry.npm.taobao.org
# 單次使用淘寶鏡像(會(huì)使用的老鳥可忽略此步驟)
$ npm install -g node-gyp --registry=https://registry.npm.taobao.org
$ npm install -g --production windows-build-tools --registry=https://registry.npm.taobao.org

2. 手動(dòng)安裝,針對(duì)擁有非純凈 Windows 開發(fā)環(huán)境的老鳥(安裝過 Python, Visual Studio 等…)

重點(diǎn)注意: 等到 Starting installation... 命令字樣出現(xiàn)后,立馬 Ctrl + C 終止后面的安裝過程
!!! 因?yàn)槲覀儽仨氉远x安裝這兩個(gè)新環(huán)境,才能不影響我們系統(tǒng)中已安裝的 python 和 vs 等環(huán)境。

巧妙獲取 python2 和 msvs_version 相關(guān)版本的安裝包

$ npm install --global --production windows-build-tools
npm WARN deprecated windows-build-tools@5.2.2: Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

> windows-build-tools@5.2.2 postinstall D:\app\nodejs\node_global\node_modules\windows-build-tools
> node ./dist/index.js

Downloading python-2.7.15.amd64.msi
[============================================>] 100.0% of 20.2 MB (9 MB/s)
Downloaded python-2.7.15.amd64.msi. Saved to C:\Users\cpw\.windows-build-tools\python-2.7.15.amd64.msi.
Downloading vs_BuildTools.exe
[============================================>] 100.0% of 1.12 MB (1.12 MB/s)
Downloaded vs_BuildTools.exe. Saved to C:\Users\cpw\.windows-build-tools\vs_BuildTools.exe.

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!

Status from the installers:
---------- Visual Studio Build Tools ----------
Still waiting for installer log file...
------------------- Python --------------------
Still waiting for installer log file...^C

手動(dòng)安裝 python2 和 msvs_version 到自定義目錄

# 靜默安裝 python2 到指定的目錄
Microsoft Windows [版本 10.0.19044.1706]
(c) Microsoft Corporation。保留所有權(quán)利。

C:\Users\cpw\.windows-build-tools>msiexec /a C:\Users\cpw\.windows-build-tools\python-2.7.15.amd64.msi /quiet TargetDir="C:/app/pvm/v2.7.15"
# 靜默安裝 vs_BuildTools 到默認(rèn)的目錄
C:\Users\cpw\.windows-build-tools>vs_BuildTools.exe /quiet PrependPath=0 Include_launcher=0 Include_test=0 Include_tcltk=0 Shortcuts=0

全局設(shè)置 python2 和 msvs_version 環(huán)境變量

# 全局設(shè)置 python2 環(huán)境變量
$ npm config set python2 "C:\Python27\python.exe"
# 全局設(shè)置 buildTools 環(huán)境變量
$ npm config set msvs_version "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"

查看 NPM 全局配置

$ npm config list -g
; cli configs
global = true
metrics-registry = "https://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/6.14.13 node/v14.17.0 win32 x64"

; userconfig C:\Users\cpw\.npmrc
CHROMEDRIVER_CDNURL = "https://npm.taobao.org/mirrors/chromedriver"
ELECTRON_BUILDER_BINARIES_MIRROR = "https://npm.taobao.org/mirrors/electron-builder-binaries/"
ELECTRON_MIRROR = "https://npm.taobao.org/mirrors/electron/"
NVM_NODEJS_ORG_MIRROR = "https://npm.taobao.org/mirrors/node"
OPERADRIVER = "https://npm.taobao.org/mirrors/operadriver"
PYTHON_MIRROR = "https://npm.taobao.org/mirrors/python"
cache = "D:\\app\\nodejs\\npm-cache"
chromedriver_cdnurl = "https://npm.taobao.org/mirrors/chromedriver"
electron-builder-binaries_mirror = "https://npm.taobao.org/mirrors/electron-builder-binaries/"
electron_mirror = "https://npm.taobao.org/mirrors/electron/"
msvs_version = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools"
node_sqlite3_binary_host_mirror = "http://npm.taobao.org/mirrors"
phantomjs_cdnurl = "https://npm.taobao.org/mirrors/phantomjs"
prefix = "D:\\app\\nodejs\\node_global"
python = "?D:\\app\\pvm\\v2.7.15\\python.exe"
registry = "https://registry.npm.taobao.org/"
sass_binary_site = "https://npm.taobao.org/mirrors/node-sass/"
strict-ssl = false

; node bin location = D:\app\nodejs\node.exe
; cwd = D:\code\NodejsProjects\lx-music-desktop
; HOME = C:\Users\cpw
; "npm config ls -l" to show all defaults.

總結(jié)

到此這篇關(guān)于NPM相關(guān)命令之報(bào)錯(cuò)node-gyp...解決的文章就介紹到這了,更多相關(guān)NPM報(bào)錯(cuò)node-gyp...解決內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • nodejs爬蟲初試superagent和cheerio

    nodejs爬蟲初試superagent和cheerio

    這篇文章主要介紹了nodejs爬蟲初試superagent和cheerio的相關(guān)知識(shí),非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下
    2018-03-03
  • 基于模板引擎Jade的應(yīng)用(詳解)

    基于模板引擎Jade的應(yīng)用(詳解)

    下面小編就為大家分享一篇基于模板引擎Jade的應(yīng)用詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2017-12-12
  • node.js基于dgram數(shù)據(jù)報(bào)模塊創(chuàng)建UDP服務(wù)器和客戶端操作示例

    node.js基于dgram數(shù)據(jù)報(bào)模塊創(chuàng)建UDP服務(wù)器和客戶端操作示例

    這篇文章主要介紹了node.js基于dgram數(shù)據(jù)報(bào)模塊創(chuàng)建UDP服務(wù)器和客戶端操作,結(jié)合實(shí)例形式分析了node.js使用dgram數(shù)據(jù)報(bào)模塊創(chuàng)建UDP服務(wù)器和客戶端,以及進(jìn)行UDP廣播、組播相關(guān)操作技巧,需要的朋友可以參考下
    2020-02-02
  • node.js中stream流中可讀流和可寫流的實(shí)現(xiàn)與使用方法實(shí)例分析

    node.js中stream流中可讀流和可寫流的實(shí)現(xiàn)與使用方法實(shí)例分析

    這篇文章主要介紹了node.js中stream流中可讀流和可寫流的實(shí)現(xiàn)與使用方法,結(jié)合實(shí)例形式分析了node.js stream流可讀流和可寫流基本分類、原理、定義、使用方法及相關(guān)注意事項(xiàng),需要的朋友可以參考下
    2020-02-02
  • 從零學(xué)習(xí)node.js之簡(jiǎn)易的網(wǎng)絡(luò)爬蟲(四)

    從零學(xué)習(xí)node.js之簡(jiǎn)易的網(wǎng)絡(luò)爬蟲(四)

    簡(jiǎn)單的爬蟲實(shí)現(xiàn)原理很簡(jiǎn)單:發(fā)送http請(qǐng)求至目標(biāo)地址獲取HTML頁面數(shù)據(jù),然后從獲取來的頁面數(shù)據(jù)中提取需要的數(shù)據(jù)保存。下面這篇文章主要介紹了利用node.js實(shí)現(xiàn)簡(jiǎn)易的網(wǎng)絡(luò)爬蟲的相關(guān)資料,需要的朋友可以參考下。
    2017-02-02
  • 使用 Node.js 實(shí)現(xiàn)圖片的動(dòng)態(tài)裁切及算法實(shí)例代碼詳解

    使用 Node.js 實(shí)現(xiàn)圖片的動(dòng)態(tài)裁切及算法實(shí)例代碼詳解

    這篇文章主要介紹了使用 Node.js 實(shí)現(xiàn)圖片的動(dòng)態(tài)裁切功能,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2018-09-09
  • 使用GruntJS構(gòu)建Web程序之合并壓縮篇

    使用GruntJS構(gòu)建Web程序之合并壓縮篇

    前一篇講述了如何使用concat和uglify命令實(shí)現(xiàn)JavaScript資源的合并,壓縮。這篇講述下css資源的合并和壓縮。
    2014-06-06
  • Node.js fs模塊原理及常見用途

    Node.js fs模塊原理及常見用途

    這篇文章主要介紹了Node.js fs模塊原理及常見用途,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-10-10
  • 使用NODE.JS創(chuàng)建一個(gè)WEBSERVER(服務(wù)器)的步驟

    使用NODE.JS創(chuàng)建一個(gè)WEBSERVER(服務(wù)器)的步驟

    在 node.js 中創(chuàng)建一個(gè)服務(wù)器非常簡(jiǎn)單,只需要使用 node.js 為我們提供的 http 模塊及相關(guān) API 即可創(chuàng)建一個(gè)麻雀雖小但五臟俱全的web 服務(wù)器,相比 Java/Python/Ruby 搭建web服務(wù)器的過程簡(jiǎn)單的很。本文簡(jiǎn)單的講解下實(shí)現(xiàn)步驟
    2021-06-06
  • ubuntu下安裝nodejs以及升級(jí)的辦法

    ubuntu下安裝nodejs以及升級(jí)的辦法

    本文介紹了ubuntu 12.04服務(wù)器安裝nodejs以及升級(jí)的方法,ubuntu安裝nodejs以及升級(jí)的實(shí)例教程,需要的朋友參考下。
    2015-05-05

最新評(píng)論

右玉县| 周口市| 峨山| 博乐市| 牟定县| 海城市| 保山市| 温州市| 崇左市| 泸西县| 福建省| 溆浦县| 大英县| 仙桃市| 双牌县| 宾川县| 荆门市| 平阳县| 大埔县| 贺州市| 大厂| 兰州市| 望谟县| 洛阳市| 博客| 贵港市| 朔州市| 靖远县| 苏尼特右旗| 韶关市| 银川市| 惠来县| 北流市| 剑川县| 平潭县| 时尚| 疏勒县| 通江县| 阿拉善盟| 荆州市| 团风县|