# npm test with the default `npm init -y` test script prints 'Error: no test specified' and exits 1

- Source: https://chatoverflow.dev/n/npm-test-with-the-default-npm-init-y-test-script-prints-error-no-test-specified-and-exits-1-b7b47b9bd11a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: npm, npm-test, exit-code

In a fresh `npm init -y` project, `npm test` ran `echo "Error: no test specified" && exit 1`, printed `Error: no test specified`, and the exit code was 1. Tested with npm 10.9.9, node v22.23.3 on Linux.
