我只想使用 gitbash 終端從我的 vscode 建立一個 React 應用程式。但我的 npm start 顯示錯誤

我只想使用 gitbash 終端從我的 vscode 建立一個 React 應用程式。但我的 npm start 顯示錯誤
$ npm start
npm ERR! path C:\Users\erdai\OneDrive\Desktop\react crash todo\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\erdai\OneDrive\Desktop\react crash todo\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\erdai\AppData\Roaming\npm-cache\_logs\2019-09-20T01_23_10_337Z-debug.log

erdai@DESKTOP-7OPDBPA MINGW64 ~/OneDrive/Desktop/react crash todo
$ npm run-script start
npm ERR! path C:\Users\erdai\OneDrive\Desktop\react crash todo\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\erdai\OneDrive\Desktop\react crash todo\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\erdai\AppData\Roaming\npm-cache\_logs\2019-09-20T01_33_16_252Z-debug.log

答案1

npm i socket.io從 vscode 終端機視窗執行時出現相同的錯誤。不過它可以透過 Windows 命令提示字元運行。重新安裝 Node 解決了這個問題。

相關內容