[英]How can I fix "npm ERR! code1"
我試圖檢查一些開源項目來學習。 我在終端上安裝了 npm 以下載軟件包,但我收到此錯誤並且無法理解導致錯誤的原因。 一開始我是一個舊項目,它給了我舊包的錯誤並建議我更新它們,我刪除了舊的 package-lock.json 文件並從 pacgake.json 更新了依賴項。
我使用“npm outdated --depth=3”來查看丟失了哪些包。
Package Current Wanted Latest Location Depended by
angular MISSING 1.8.3 1.8.3 - PlainCAT
angular-animate MISSING 1.8.3 1.8.3 - PlainCAT
angular-block-ui MISSING 0.2.2 0.2.2 - PlainCAT
angular-confirm1 MISSING 1.1.0 1.1.0 - PlainCAT
angular-sanitize MISSING 1.8.3 1.8.3 - PlainCAT
angular-toastr MISSING 1.7.0 2.1.1 - PlainCAT
angular-ui-bootstrap MISSING 2.5.6 2.5.6 - PlainCAT
bluebird MISSING 3.7.2 3.7.2 - PlainCAT
bootstrap MISSING 3.4.1 5.1.3 - PlainCAT
electron-context-menu MISSING 0.9.1 3.1.2 - PlainCAT
electron-is-dev MISSING 0.3.0 2.0.0 - PlainCAT
electron-search-text MISSING 0.3.0 0.3.0 - PlainCAT
jquery MISSING 2.2.4 3.6.0 - PlainCAT
jschardet MISSING 1.6.0 3.0.0 - PlainCAT
node-cache MISSING 4.2.1 5.1.2 - PlainCAT
node-storage MISSING 0.0.7 0.0.9 - PlainCAT
nodehun MISSING 2.0.12 3.0.2 - PlainCAT
sha1-file MISSING 1.0.4 3.0.0 - PlainCAT
underscore MISSING 1.13.3 1.13.3 - PlainCAT
在我更新 package.json 上的版本后,我再次嘗試“npm install”,但我再次收到錯誤。
npm WARN deprecated har-validator@5.1.5:不再支持此庫 npm WARN deprecated uuid@3.4.0:請升級到版本 7 或更高版本。 舊版本可能會在某些情況下使用 Math.random(),這是眾所周知的問題。 有關詳細信息,請參閱https://v8.dev/blog/math-random 。 npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated angular-sanitize@1.8.3 :對於積極支持的 883107802328818, see //www.npmjs.com/package/@angular/core 。 AngularJS 支持已正式結束。 有關擴展的 AngularJS 支持選項,請參閱https://goo.gle/angularjs-path-forward 。 npm WARN deprecated angular-animate@1.8.3:對於積極支持的 Angular,請參閱https://www.npmjs.com/package/@angular/core 。 AngularJS 支持已正式結束。 有關擴展的 AngularJS 支持選項,請參閱https://goo.gle/angularjs-path-forward 。 npm WARN deprecated angular@1.8.3:對於積極支持的 Angular,請參閱https://www.npmjs.com/package/@angular/core 。 AngularJS 支持已正式結束。 有關擴展的 AngularJS 支持選項,請參閱https://goo.gle/angularjs-path-forward 。 npm ERR:代碼 1 npm ERR:路徑 C.\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\nodehun npm ERR。 命令失敗 npm ERR。 命令 C.\WINDOWS\system32\cmd.exe /d /s /c node-gyp 重建 npm ERR。 gyp 信息如果以 ok npm ERR 結尾,它就可以工作。 gyp 信息使用 node-gyp@6:1.0 npm ERR,gyp 信息使用 node@16.14.2 | Win32 | x64 npm 錯誤。 gyp 信息查找 Python 使用 Python 版本 3:8:5 在“C.\Users\bugra\anaconda3\python:exe”找到 npm ERR! 吉普錯誤! 找到 VS npm 錯誤! 吉普錯誤! 發現 VS msvs_version not set from command line 或 npm config npm ERR! 吉普錯誤! 發現 VS VCINSTALLDIR 未設置,未在 VS 命令提示符中運行 npm ERR! 吉普錯誤! 找到 VS 檢查 VS2019 (16.11.31727.386) 找到:npm ERR! 吉普錯誤! 找到 VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" npm 錯誤! 吉普錯誤! 找到 VS - 找到“Visual Studio C++ 核心功能” npm ERR! 吉普錯誤! 找到 VS - 缺少任何 VC++ 工具集 npm ERR! 吉普錯誤! 找到 VS 找不到要使用的 Visual Studio 2017 或更新版本 npm ERR! 吉普錯誤! find VS 尋找 Visual Studio 2015 npm ERR! 吉普錯誤! 查找 VS - 未找到 npm 錯誤! 吉普錯誤! 查找 VS 不查找 VS2013,因為它最多只支持 Node.js 8 npm ERR! 吉普錯誤! 找到 VS npm 錯誤! 吉普錯誤! 找到VS *************************************************** ************** npm 錯誤! 吉普錯誤! 找VS 你需要安裝最新版的Visual Studio npm ERR! 吉普錯誤! 找到 VS,包括“使用 C++ 進行桌面開發”工作負載。 npm 錯誤! 吉普錯誤! 找到 VS 有關更多信息,請參閱文檔:npm ERR! 吉普錯誤! 找到 VS https://github.com/nodejs/node-gyp#on-windows npm ERR: gyp ERR。 找到VS *************************************************** ************** npm 錯誤:gyp 錯誤。 找到VS npm ERR: gyp ERR: configure error npm ERR: gyp ERR。 堆棧錯誤:找不到任何 Visual Studio 安裝以使用 npm ERR:gyp ERR。 堆棧在 VisualStudioFinder:fail (C.\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio:js:121:47) npm ERR。 gyp ERR:堆棧在 C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio:js.74:16 npm ERR:gyp ERR:堆棧在 VisualStudioFinder.findVisualStudio2013 (C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio:js:351.14) npm ERR: gyp ERR: stack at C.\Users\bugra\OneDrive \Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio:js:70:14 npm 錯誤。 gyp ERR:堆棧位於 C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\find-visualstudio:js:372:16 npm ERR:gyp ERR。 堆棧在 C.\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\util:js.54:7 npm ERR。 gyp 錯誤:堆棧位於 C.\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\node-gyp\lib\util.js.33.16 npm 錯誤! 吉普錯誤! 堆棧在 ChildProcess.exithandler (node:child_process:406:5) npm 錯誤! 吉普錯誤! 堆棧在 ChildProcess.emit (node:events:526:28) npm 錯誤! 吉普錯誤! 堆棧在 maybeClose (node:internal/child_process:1092:16) npm 錯誤! 吉普錯誤! 系統 Windows_NT 10.0.22000 npm 錯誤! 吉普錯誤! 命令“C:\呃! 吉普錯誤! cwd C:\Users\bugra\OneDrive\Desktop\bitirme projesi plaincat\PlainCAT\node_modules\nodehun npm 錯誤! 吉普錯誤! 節點-v v16.14.2 npm 錯誤! 吉普錯誤! node-gyp -v v6.1.0 npm 錯誤! 吉普錯誤! 不好
npm ERR:此運行的完整日志可在以下位置找到:npm ERR!
C:\Users\bugra\AppData\Local\npm-cache_logs\2022-04-27T17_33_39_922Z-debug-0.log
您是否嘗試按照錯誤消息中的說明安裝 Visual Studio? 如果已安裝,它是否在路徑上?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.