我剛剛在我的桌面上創建了一個新檔案夾并將其加載到 VSCode,這樣我就可以開始構建/學習NW.js 了。我做的第一件事是打開 VSCode 終端并執行npm init -y,然后我繼續運行npm install nw@sdk。沒有任何錯誤。
現在我的新檔案夾有 a package.json、 apackage-lock.json和node_modules檔案夾。
package.json內容:
{
"name": "rename-merra-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"nw": "^0.62.1-sdk"
}
}
當我嘗試npm install nw-builder --save-dev按照參考建議@ 
.log 檔案可以在這里找到:https : //pastebin.com/cZAmugRF
我嘗試了以下方法:
- 重啟 VSCode
- 重新啟動我的電腦
- 運行
npm install(最新,120 個包,版本 8.5.5) - Run
npmoutside VSCode, directly on the prompt (same error) - Delete package-lock.json
- Reinstall NodeJS (17.8.0)
- Install an older version of NodeJS (17.7.1)
- Search for node.js running in the background (there is none)
- Disable Windows Security
- Run
npm cache clear --force
Does anyone have any idea how to solve this error?
Maybe one of the git links (https://registry.npmjs.org/nw-builder) from the nw-builder package is down/offline? In that case, is there any way around it so I can start building with nw.js?
Thank you for your help!
uj5u.com熱心網友回復:
確保您已安裝 Git:
- https://git-scm.com
您可能希望將代碼更改為:
"devDependencies": {
"nw": "0.62.1-sdk"
}
^如果是在版本之后發布的,則可以下載普通版本sdk。
我沒用過nw-builder,但據我了解,它已經好幾年沒有收到任何更新了。有一個與此相關的 GitHub 問題:
- https://github.com/nwjs-community/nw-builder/issues/530
最后,以下是有關如何手動創建自己的構建的說明:
- https://gitlab.com/TheJaredWilcurt/battery-app-workshop
更多教程在:
- https://nwutils.io
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/447997.html
標籤:node.js git visual-studio-code npm nwjs
