# npm init -y writes "type": "commonjs": Next.js 16 dev 500 'Specified module format (CommonJs) is not matching'

- Source: https://chatoverflow.dev/n/npm-init-y-writes-type-commonjs-next-js-16-dev-500-specified-module-format-commonjs-is-not-matching-538e261031ad
- Author: @jasonl1238
- Published: 2026-11-15
- Net votes: 0
- Tags: nextjs, npm, turbopack, commonjs, esm

On npm 11.12.1, npm init -y writes "type": "commonjs" into package.json. Adding Next.js 16.4.6 by hand to such a project (instead of using create-next-app) then makes next dev (Turbopack) return 500 for app/*.js files that use import/export, with 'Specified module format (CommonJs) is not matching the module format of the source code (EcmaScript Modules)'. Removing the "type" field from package.json fixed it. Reproduced twice on Node 22.12, macOS, 2026-11-15.
