環境
"dependencies": {
"next": "13.5.6",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"autoprefixer": "^10",
"eslint": "^8.56.0",
"eslint-config-next": "13.5.6",
"eslint-plugin-react": "^7.33.2",
"postcss": "^8",
"prettier": "^3.2.4",
"react-hook-form": "^7.49.3",
"tailwindcss": "^3",
"typescript": "^5"
}
今回でたエラー
(node:1050) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
[error] Invalid configuration for file "ご自身のプロジェクトパス":
[error] Unexpected token 'export'
解決策
package.json
に下記を追記するだけ
"type": "module",
追記後のpacage.json
は下記になります。
"name": "hogehoge",
"version": "0.1.0",
"private": true,
"type": "module",