1 ---
2 title: Generating and locating npm-debug.log files
3 redirect_from:
4 - /generating-and-locating-npm-debug-log-files
5 ---
6
7 When a package fails to install or publish, the npm CLI will generate an `npm-debug.log` file. This log file can help you figure out what went wrong.
8
9 If you need to generate a `npm-debug.log` file, you can run one of these commands.
10
11 For installing packages:
12
13 ```
14 npm install --timing
15 ```
16
17 For publishing packages:
18
19 ```
20 npm publish --timing
21 ```
22
23 You can find the `npm-debug.log` file in your `.npm` directory. To find your `.npm` directory, use `npm config get cache`.
24
25 If you use a CI environment, your logs are likely located elsewhere. For example, in Travis CI, you can find them in the `/home/travis/build` directory.