{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/19393","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/19393/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/19393/comments","events_url":"https://api.github.com/repos/npm/npm/issues/19393/events","html_url":"https://github.com/npm/npm/issues/19393","id":281839079,"number":19393,"title":"npm list errors on 5.6.0 with optional dependencies not installed","user":{"login":"richardowen","id":1186519,"avatar_url":"https://avatars1.githubusercontent.com/u/1186519?v=4","gravatar_id":"","url":"https://api.github.com/users/richardowen","html_url":"https://github.com/richardowen","followers_url":"https://api.github.com/users/richardowen/followers","following_url":"https://api.github.com/users/richardowen/following{/other_user}","gists_url":"https://api.github.com/users/richardowen/gists{/gist_id}","starred_url":"https://api.github.com/users/richardowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardowen/subscriptions","organizations_url":"https://api.github.com/users/richardowen/orgs","repos_url":"https://api.github.com/users/richardowen/repos","events_url":"https://api.github.com/users/richardowen/events{/privacy}","received_events_url":"https://api.github.com/users/richardowen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2017-12-13T17:48:48Z","updated_at":"2018-05-03T19:09:46Z","closed_at":null,"author_association":"NONE","body":"#### I'm opening this issue because:\r\n\r\nnpm is returning an error\r\n\r\n#### What's going wrong?\r\n\r\nWith a package that has optional dependencies, if the package is installed but the optional dependencies are not, when running `npm list`, npm 5.6.0 throws an error stating that the dependencies of the optional dependencies are not installed. Scenario:\r\n\r\n* p1 has optional dependency p2\r\n* p2 has dependency p3\r\n* When installing p1 and running `npm list`, npm throws an error that p3 is not installed\r\n\r\nThis might have been caused by the change in 5.6.0 to generate the `package-lock.json` consistently across platforms.\r\n\r\n#### How can the CLI team reproduce the problem?\r\n\r\n* Do the following on an ubuntu 16.04 server\r\n* Create a `package.json` with the following content:\r\n```\r\n{\r\n  \"dependencies\": {\r\n    \"chokidar\": \"1.7.0\"\r\n  }\r\n}\r\n```\r\n* Run `npm install`\r\n* Run `npm list`\r\n* Instead of successfully returning the list, npm returns errors that dependencies are not installed and returns exit code 1. Full output at https://gist.github.com/richardowen/c43358831fa5040448ab21f9f66c0afe.\r\n\r\n\r\n### supporting information:\r\n\r\n - `npm -v` prints:\r\n5.6.0\r\n - `node -v` prints:\r\nv6.12.2\r\n - `npm config get registry` prints:\r\nhttps://registry.npmjs.org/\r\n - Windows, OS X/macOS, or Linux?:\r\nLinux - Ubuntu 16.04"},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/386404733","html_url":"https://github.com/npm/npm/issues/19393#issuecomment-386404733","issue_url":"https://api.github.com/repos/npm/npm/issues/19393","id":386404733,"user":{"login":"DullReferenceException","id":4923668,"avatar_url":"https://avatars0.githubusercontent.com/u/4923668?v=4","gravatar_id":"","url":"https://api.github.com/users/DullReferenceException","html_url":"https://github.com/DullReferenceException","followers_url":"https://api.github.com/users/DullReferenceException/followers","following_url":"https://api.github.com/users/DullReferenceException/following{/other_user}","gists_url":"https://api.github.com/users/DullReferenceException/gists{/gist_id}","starred_url":"https://api.github.com/users/DullReferenceException/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DullReferenceException/subscriptions","organizations_url":"https://api.github.com/users/DullReferenceException/orgs","repos_url":"https://api.github.com/users/DullReferenceException/repos","events_url":"https://api.github.com/users/DullReferenceException/events{/privacy}","received_events_url":"https://api.github.com/users/DullReferenceException/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T19:09:46Z","updated_at":"2018-05-03T19:09:46Z","author_association":"NONE","body":"Still occurring with `^6.0.0` as well."}}
{"actor":{"display_login":"DullReferenceException"}}