項目啟動 npm run dev運行報錯
PS D:\VSCODE\express-demo> npm run dev//跟著視頻的步驟報錯
npm ERR! missing script: dev
npm ERR! A complete log of this run can be found in:
npm ERR!? ? ?D:\nodejs\node_cache\_logs\2021-04-13T06_09_30_179Z-debug.log
PS D:\VSCODE\express-demo> npm start//使用之前的啟動方法報錯
> [email protected] start D:\VSCODE\express-demo
> nodemon ./src/app.js
'nodemon' 不是內部或外部命令,也不是可運行的程序
或批處理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `nodemon ./src/app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!? ? ?D:\nodejs\node_cache\_logs\2021-04-13T06_09_39_374Z-debug.log
2021-04-13
看package.json的依賴中有沒有引進nodemon 如果沒有可以使用命令 npm install --save-dev nodemon
得到解決了
2021-04-13
在VScode的終端中輸入命令是報錯的,但是在cmd中運行npm start服務又能正常啟動了