我正在嘗試按照教程進行操作,但在撰寫一行代碼之前就遇到了問題。只有終端命令如下所示:
*PS C:\Users\ruben\OneDrive\Bureaublad\dapp> cd .\client\
PS C:\Users\ruben\OneDrive\Bureaublad\dapp\client> npm init vite@latest
√ Project name: ... ./
√ Select a framework: ? react
√ Select a variant: ? react
Scaffolding project in C:\Users\ruben\OneDrive\Bureaublad\dapp\client\...
Done. Now run:
npm install
npm run dev
PS C:\Users\ruben\OneDrive\Bureaublad\dapp\client> npm install
added 76 packages, and audited 77 packages in 6s
7 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
PS C:\Users\ruben\OneDrive\Bureaublad\dapp\client> npm run dev
> dapp1@0.0.0 dev
> vite
Pre-bundling dependencies:
react
react-dom
react/jsx-dev-runtime
(this will be run only when your dependencies or config have changed)
vite v2.7.10 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 467ms.*
當我轉到本地主機時,我會看到一個空白頁面(在教程中它顯示了一個視覺效果和一些文本。
當我檢查頁面時,出現錯誤:
:3000/:1
GET http://localhost:3000/ 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/webpack.js?ts=1641050312655
net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/main.js?ts=1641050312655
net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/react-refresh.js?
ts=1641050312655 net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/pages/_app.js?
ts=1641050312655 net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/pages/_error.js?
ts=1641050312655 net::ERR_ABORTED 500 (Internal Server Error)
以及這個問題:
頁面或腳本正在訪問 navigator.userAgent、navigator.appVersion 和 navigator.platform 中的至少一個。從 Chrome 101 開始,用戶代理字串中可用的資訊量將減少。要解決此問題,請將 navigator.userAgent、navigator.appVersion 和 navigator.platform 的用法替換為特征檢測、漸進增強或遷移到 navigator.userAgentData。請注意,出于性能原因,僅顯示對其中一個屬性的第一次訪問。1個源bubble_compiled.js:1
uj5u.com熱心網友回復:
這可能是一個許可問題。您正在 OneDrive 檔案夾中作業。因此,OneDrive 有可能不斷觀察內部檔案夾內的每一個變化,并阻止其他應用程式的訪問。嘗試在另一個檔案夾中重新啟動您的專案。最好在“C:\Users\ruben\Desktop”中。
uj5u.com熱心網友回復:
確保您至少使用 npm v6 我剛剛在 node v17 上嘗試過這個,它在 npm v7 上運行良好。我遵循的檔案在這里
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/402813.html
標籤:
