{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26359","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26359/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26359/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26359/events","html_url":"https://github.com/Microsoft/TypeScript/issues/26359","id":349547055,"node_id":"MDU6SXNzdWUzNDk1NDcwNTU=","number":26359,"title":"Error code 1 on compile causes npm to exit","user":{"login":"krinsman","id":31422259,"node_id":"MDQ6VXNlcjMxNDIyMjU5","avatar_url":"https://avatars2.githubusercontent.com/u/31422259?v=4","gravatar_id":"","url":"https://api.github.com/users/krinsman","html_url":"https://github.com/krinsman","followers_url":"https://api.github.com/users/krinsman/followers","following_url":"https://api.github.com/users/krinsman/following{/other_user}","gists_url":"https://api.github.com/users/krinsman/gists{/gist_id}","starred_url":"https://api.github.com/users/krinsman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krinsman/subscriptions","organizations_url":"https://api.github.com/users/krinsman/orgs","repos_url":"https://api.github.com/users/krinsman/repos","events_url":"https://api.github.com/users/krinsman/events{/privacy}","received_events_url":"https://api.github.com/users/krinsman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-10T14:54:30Z","updated_at":"2018-08-10T15:54:44Z","closed_at":null,"author_association":"NONE","body":"This is a duplicate of https://github.com/Microsoft/TypeScript/issues/8186 . I would have commented on that issue, but Microsoft closed commenting on it, so now I have to file this as a separate issue.\r\n\r\nAlso, this issue technically isn't a duplicate, since the above issue was for Windows only, but this is happening on Linux.\r\n\r\nAnyway, I am using [a complicated JavaScript library with somewhat ambiguous documentation](https://datatables.net/reference/option/ajax), so the [community-created TypeScript interface file](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/datatables.net/index.d.ts) for it isn't always 100% perfect. So often I will have perfectly valid code (in terms of allowed types and whatnot), but TypeScript will still exit with an error code of 1 because the interface file for this library is, again, not 100% perfect.\r\n\r\nThis would be fine, except that when TypeScript is being run within an npm workflow (via `npm run build`), it causes the entire npm build script to fail entirely. So now I can't update my code.\r\n\r\nHere is the output from npm\r\n\r\n```\r\nsrc/index.ts(77,52): error TS2345: Argument of type 'object' is not assignable to parameter of type 'string'.\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! errno 1\r\nnpm ERR! package@0.1.0 build: `tsc`\r\nnpm ERR! Exit status 1\r\nnpm ERR! \r\nnpm ERR! Failed at the package@0.1.0 build script.\r\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\r\n\r\nnpm ERR! A complete log of this run can be found in:\r\nnpm ERR!     /krinsman/.npm/_logs/2018-08-10T14_29_16_882Z-debug.log\r\n```\r\n\r\nHere's the log\r\n\r\n```\r\n0 info it worked if it ends with ok\r\n1 verbose cli [ '/krinsman/miniconda/envs/test/bin/node',\r\n1 verbose cli   '/krinsman/miniconda/envs/test/bin/npm',\r\n1 verbose cli   'run',\r\n1 verbose cli   'build' ]\r\n2 info using npm@5.6.0\r\n3 info using node@v8.11.3\r\n4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]\r\n5 info lifecycle package@0.1.0~prebuild: package@0.1.0\r\n6 info lifecycle package@0.1.0~build: package@0.1.0\r\n7 verbose lifecycle package@0.1.0~build: unsafe-perm in lifecycle true\r\n8 verbose lifecycle package@0.1.0~build: PATH: /krinsman/miniconda/envs/test/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/krinsman/package/node_modules/.bin:/krinsman/miniconda/envs/test/bin\r\n9 verbose lifecycle package@0.1.0~build: CWD: /krinsman/package\r\n10 silly lifecycle package@0.1.0~build: Args: [ '-c', 'tsc' ]\r\n11 silly lifecycle package@0.1.0~build: Returned: code: 1  signal: null\r\n12 info lifecycle package@0.1.0~build: Failed to exec build script\r\n13 verbose stack Error: package@0.1.0 build: `tsc`\r\n13 verbose stack Exit status 1\r\n13 verbose stack     at EventEmitter.<anonymous> (/krinsman/miniconda/envs/test/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)\r\n13 verbose stack     at emitTwo (events.js:126:13)\r\n13 verbose stack     at EventEmitter.emit (events.js:214:7)\r\n13 verbose stack     at ChildProcess.<anonymous> (/krinsman/miniconda/envs/test/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)\r\n13 verbose stack     at emitTwo (events.js:126:13)\r\n13 verbose stack     at ChildProcess.emit (events.js:214:7)\r\n13 verbose stack     at maybeClose (internal/child_process.js:925:16)\r\n13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)\r\n14 verbose pkgid package@0.1.0\r\n15 verbose cwd /krinsman/package\r\n16 verbose Linux 4.4.114-94.11-default\r\n17 verbose argv \"/krinsman/miniconda/envs/test/bin/node\" \"/krinsman/miniconda/envs/test/bin/npm\" \"run\" \"build\"\r\n18 verbose node v8.11.3\r\n19 verbose npm  v5.6.0\r\n20 error code ELIFECYCLE\r\n21 error errno 1\r\n22 error package@0.1.0 build: `tsc`\r\n22 error Exit status 1\r\n23 error Failed at the package@0.1.0 build script.\r\n23 error This is probably not a problem with npm. There is likely additional logging output above.\r\n24 verbose exit [ 1, true ]\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/412126162","html_url":"https://github.com/Microsoft/TypeScript/issues/26359#issuecomment-412126162","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/26359","id":412126162,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjEyNjE2Mg==","user":{"login":"andy-ms","id":19274678,"node_id":"MDQ6VXNlcjE5Mjc0Njc4","avatar_url":"https://avatars3.githubusercontent.com/u/19274678?v=4","gravatar_id":"","url":"https://api.github.com/users/andy-ms","html_url":"https://github.com/andy-ms","followers_url":"https://api.github.com/users/andy-ms/followers","following_url":"https://api.github.com/users/andy-ms/following{/other_user}","gists_url":"https://api.github.com/users/andy-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-ms/subscriptions","organizations_url":"https://api.github.com/users/andy-ms/orgs","repos_url":"https://api.github.com/users/andy-ms/repos","events_url":"https://api.github.com/users/andy-ms/events{/privacy}","received_events_url":"https://api.github.com/users/andy-ms/received_events","type":"User","site_admin":false},"created_at":"2018-08-10T15:54:44Z","updated_at":"2018-08-10T15:54:44Z","author_association":"CONTRIBUTOR","body":"Even if the interface is wrong, you should be able to avoid compile errors in your source code using `as any` casts. So if there's a method you want to call that doesn't exist, you could change `obj.m()` to `(obj as any).m()`."}}
{"actor":{"display_login":"andy-ms"}}