簡體   English   中英

TRACKER:錯誤TRK0005:找不到:“CL.exe”。 該系統找不到指定的文件

[英]TRACKER : error TRK0005: Failed to locate: “CL.exe”. The system cannot find the file specified

我正在嘗試在Windows 8上的Node.js項目中執行以下命令:

npm install web3@1.0.0-beta.24

但我有一個錯誤,我有節點想法如何處理。

TRACKER:錯誤TRK0005:找不到:“CL.exe”。 該系統找不到指定的文件。 [C:\\項目\\ myproject的\\ node_modules \\ scrypt \\建立\\ copied_files.vcxproj]

這是整個輸出:

scrypt@6.0.3預安裝C:\\ Projects \\ myproject \\ node_modules \\ scrypt節點node-scrypt-preinstall.js

scrypt@6.0.3安裝C:\\ Projects \\ myproject \\ node_modules \\ scrypt node-gyp rebuild

C:\\ Projects \\ myproject \\ node_modules \\ scrypt>如果沒有定義npm_config_node_gyp(節點“C:\\ Program Files \\ nodejs \\ node_modules \\ npm \\ bin \\ node-gyp-bin \\ .... \\ node_modules \\ node-gyp \\ bin \\ node -g yp.js“rebuild”else(node“”rebuild)警告:缺少輸入文件:C:\\ Projects \\ myproject \\ node_modules \\ scrypt \\ build .. \\ scrypt \\ win \\ include \\ config.h構建項目在這個解決方案中一次一個。 要啟用並行構建,請添加“/ m”開關。 C:\\ Program Files(x86)\\ MSBuild \\ Microsoft.Cpp \\ v4.0 \\ V140 \\ Microsoft.CppBuild.targets(366,5):警告MSB8003:無法從注冊表中找到WindowsSDKDir變量。 TargetFrameworkVersion或PlatformToolset可能設置為無效的版本號。 [C:\\ Projects \\ myproject \\ node_modules \\ scrypt \\ build \\ copied_files.vcxproj]將scrypt / win / include / config.h復制到scrypt / scrypt-1.2.0 / config.h系統找不到指定的文件。 TRACKER:錯誤TRK0005:找不到:“CL.exe”。 該系統找不到指定的文件。 [C:\\項目\\ myproject的\\ node_modules \\ scrypt \\建立\\ copied_files.vcxproj]

C:\\ Program Files(x86)\\ MSBuild \\ Microsoft.Cpp \\ v4.0 \\ V140 \\ Microsoft.CppBuild.targets(366,5):警告MSB8003:無法從注冊表中找到WindowsSDKDir變量。 TargetFrameworkVersion或PlatformToolset可能設置為無效的版本號。 [C:\\ Projects \\ myproject \\ node_modules \\ scrypt \\ build \\ scrypt_wrapper.vcxproj] TRACKER:錯誤TRK0005:找不到:“CL.exe”。 該系統找不到指定的文件。 [C:\\項目\\ myproject的\\ node_modules \\ scrypt \\建立\\ scrypt_wrapper.vcxproj]

gyp ERR! 構建錯誤gyp ERR! 堆棧錯誤: C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\msbuild.exe失敗,退出代碼:1 C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\msbuild.exe ERR! 在ChildProcess.onExit堆棧(C:\\ Program Files \\ nodejs \\ node_modules \\ npm \\ node_modules \\ node-gyp \\ lib \\ build.js:258:23)gyp ERR! 堆棧在emitTwo(events.js:126:13)gyp ERR! 在ChildProcess.emit堆棧(events.js:214:7)gyp ERR! Process.ChildProcess._handle.onexit(internal / child_process.js:198:12)gyp ERR! 系統Windows_NT 6.2.9200 gyp ERR! 命令“C:\\ Program Files \\ nodejs \\ node.exe”“C:\\ Program Files \\ nodejs \\ node_modules \\ npm \\ node_modules \\ node-gyp \\ bin \\ node-gyp.js”“rebuild”gyp ERR! cwd C:\\ Projects \\ myproject \\ node_modules \\ scrypt gyp ERR! node -v v8.9.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! 不行npm WARN inbanner@1.6.0沒有存儲庫字段。

錯誤的ERR! 代碼ELIFECYCLE npm ERR! 錯誤1 npm ERR! scrypt@6.0.3 install: node-gyp rebuild gyp node-gyp rebuild npm ERR! 退出狀態1 npm ERR! 錯誤的ERR! scrypt@6.0.3安裝腳本失敗。 錯誤的ERR! 這可能不是npm的問題。 上面可能有額外的日志記錄輸出。

錯誤的ERR! 可以在以下位置找到此運行的完整日志:npm ERR!
C:\\用戶\\用戶\\應用程序數據\\漫游\\ NPM-cache_logs \\ 2017-11-13T01_31_12_133Z-的debug.log

救命!

這個包似乎需要本機編譯。 您需要為此安裝Visual Studio C ++構建工具。 您可以從下面的鏈接下載相同的內容

http://landinghub.visualstudio.com/visual-cpp-build-tools

此后,您還需要確保路徑中有CL.exe可用。 它將位於C:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\ce\\bin類的路徑上。 這將根據您安裝的構建工具的版本而更改。

如果安裝程序沒有為您執行此操作,則需要確保更新Windows PATH環境變量。

如果npm仍然失敗,你總是可以嘗試使用yarn

yarn add web3@1.0.0-beta.24

呃! scrypt@6.0.3安裝腳本失敗。

該錯誤是由scrypt包引起的,因為node-gyp無法重建,

嘗試以管理員身份運行cmd並運行npm install scrypt@6.0.3 ,如果不起作用,請嘗試node-gyp rebuild重新安裝

如果你使用node-gyp修復你的問題,你應該在安裝node-gyp的過程中將Cl.exe放在正確的位置

我在同一條船上,在線找到的大部分答案都無法幫助(或者不是100%可行)這個重建錯誤。 在嘗試了幾種不同的方法后,我發現這種方式適用於我的機器(Windows 10 Pro)。 現在,我可以安裝web3而沒有任何問題。 (或其他與node-gyp問題相關的包,例如“truffle unbox react”)

我總結的步驟如下:

  1. 安裝NodeJS,Git
  2. 下載Windows Visual Studio 2015
  3. 打開Visual Studio 2015並創建“新項目......”

    • 選擇“創建新的C ++項目”
    • 您應該看到一個VS要求安裝“Visual C ++ 2015常用工具”和“Windows 8.1 SDK和通用CRT SDK”的菜單(此Windows 8.1 SDK文件中scrypt所需工具中的某些進程)
    • 選擇並安裝
  4. 通過npm命令安裝/鏈接python

    • npm --add-python-to-path="true" --debug install --global windows-build-tools
  5. 將msvs_version設置為2015
    • npm config set msvs_version 2015 --global
  6. 安裝web3
    • npm install web3

供參考:我的npm版本:5.6.0我的節點版本:8.9.4

希望這會有所幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM