Node.js v18.14.1 PS D:\2WarRoom\2023TCC\Week11\Learn\demo_commit_convernsion> echo "test pre-commit" | npx commitlint D:\2WarRoom\2023TCC\Week11\Learn\demo_commit_convernsion\commitlint.config.js:1 m SyntaxError: Invalid or unexpected token at internalCompileFunction (node:internal/vm:73:18) at wrapSafe (node:internal/modules/cjs/loader:1176:20) at Module._compile (node:internal/modules/cjs/loader:1218:27) at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) at Module.load (node:internal/modules/cjs/loader:1117:32) at Module._load (node:internal/modules/cjs/loader:958:12) at Module.require (node:internal/modules/cjs/loader:1141:19) at module.exports (D:\2WarRoom\2023TCC\Week11\Learn\demo_commit_convernsion\node_modules\import-fresh\index.js:32:59) at loadJsSync (D:\2WarRoom\2023TCC\Week11\Learn\demo_commit_convernsion\node_modules\cosmiconfig\dist\loaders.js:17:12) at #loadConfiguration (D:\2WarRoom\2023TCC\Week11\Learn\demo_commit_convernsion\node_modules\cosmiconfig\dist\Explorer.js:92:30) { filepath: 'D:\\2WarRoom\\2023TCC\\Week11\\Learn\\demo_commit_convernsion\\commitlint.config.js' }
Fixed
- In, step create file commitlint.config.js
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
- check commitlint.config.js encoding is UTF-8 (On Windows default UTF-16LE
Reference
Discover more from naiwaen@DebuggingSoft
Subscribe to get the latest posts sent to your email.