後端部署到heroku上跳出 Error: Cannot find module 'dotenv'    postman畫面:   如果用http://localhost:3000 是可以順利拿到資料的  ## 確認過: ### 1. heroku api 連結格式正確 https://devcenter.heroku.com/articles/heroku-connect-api  ### 2. CLI中的確有dotenv  ### 3. 如果下指令:npm install dotenv --save dotenv會從package.json中消失  ### 4. 把package-lock.json和node_modules刪除之後重新安裝,並執行 npm install dotenv --save dotenv還是會從package.json中消失 ### 5. 參考文章: https://bobbyhadz.com/blog/node-cannot-find-module-dotenv https://stackoverflow.com/questions/65685282/error-while-deploying-node-js-application-to-heroku-cannot-find-module-dotenv
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up