{"action":"opened","issue":{"url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4743","labels_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4743/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4743/comments","events_url":"https://api.github.com/repos/angular-ui/ui-grid/issues/4743/events","html_url":"https://github.com/angular-ui/ui-grid/issues/4743","id":118094060,"number":4743,"title":"package.json main attribute should be a string","user":{"login":"sbruno","id":39304,"avatar_url":"https://avatars.githubusercontent.com/u/39304?v=3","gravatar_id":"","url":"https://api.github.com/users/sbruno","html_url":"https://github.com/sbruno","followers_url":"https://api.github.com/users/sbruno/followers","following_url":"https://api.github.com/users/sbruno/following{/other_user}","gists_url":"https://api.github.com/users/sbruno/gists{/gist_id}","starred_url":"https://api.github.com/users/sbruno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbruno/subscriptions","organizations_url":"https://api.github.com/users/sbruno/orgs","repos_url":"https://api.github.com/users/sbruno/repos","events_url":"https://api.github.com/users/sbruno/events{/privacy}","received_events_url":"https://api.github.com/users/sbruno/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-20T18:05:11Z","updated_at":"2015-11-20T18:05:11Z","closed_at":null,"body":"I'm using ui-grid on a nodejs project and it is failing to do a npm publish because it expects package.json main to be a string and currently it is an array\r\n\r\n```\r\nnpm verb stack TypeError: Path must be a string. Received [ './less',\r\nnpm verb stack   './ui-grid.css',\r\nnpm verb stack   './ui-grid.eot',\r\nnpm verb stack   './ui-grid.js',\r\nnpm verb stack   './ui-grid.svg',\r\nnpm verb stack   './ui-grid.ttf',\r\nnpm verb stack   './ui-grid.woff' ]\r\nnpm verb stack     at assertPath (path.js:8:11)\r\nnpm verb stack     at Object.win32.resolve (path.js:130:5)\r\nnpm verb stack     at Packer.applyIgnores (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\fstream-npm\\fstream-npm.js:109:59)\r\nnpm verb stack     at Packer.<anonymous> (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\fstream-npm\\node_modules\\fstream-ignore\\ignore.js:181:17)\r\nnpm verb stack     at Array.filter (native)\r\nnpm verb stack     at Packer.IgnoreReader.filterEntries (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\fstream-npm\\node_modules\\fstream-ignore\\ignore.js:179:31)\r\nnpm verb stack     at Packer.<anonymous> (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\fstream-npm\\node_modules\\fstream-ignore\\ignore.js:92:12)\r\nnpm verb stack     at Packer.<anonymous> (C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\fstream-npm\\node_modules\\fstream-ignore\\ignore.js:134:5)\r\nnpm verb stack     at C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\graceful-fs\\graceful-fs.js:76:16\r\nnpm verb stack     at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)\r\n```\r\n\r\nOn older versions of node it was not failing probably because node is now doing some validation, but according to the docs, an array is not valid and it should be a string:\r\nhttps://docs.npmjs.com/files/package.json#main\r\n\r\nThe array was added by this issue: https://github.com/angular-ui/ui-grid/issues/3673\r\nIt looks as some tool extracts information from the main property of bower.json, but it does not say anything about package.json.\r\nMaybe package.json is generated from bower.json, but some special care should be taken for the main attribute.\r\nI see that in the source, package.json and bower.json are different, in fact, package.json does not contain a main attribute. But when I see my module at src\\web-app\\bower_components\\angular-ui-grid\\package.json it looks like bower.json\r\n\r\nhttps://github.com/angular-ui/ui-grid/blob/master/bower.json\r\nhttps://github.com/angular-ui/ui-grid/blob/master/package.json\r\n\r\n\r\n\r\nFor example, bootstrap-bower have different values for main in bower.json and package.json:\r\n\r\nhttps://github.com/angular-ui/bootstrap-bower/blob/master/bower.json\r\n\r\nhttps://github.com/angular-ui/bootstrap-bower/blob/master/package.json\r\n\r\n\r\nOhh... After inspecting a bit the code, it looks as the problem is in this task, that is copying the same contents to package.json and bower.json:\r\nhttps://github.com/angular-ui/ui-grid/blob/9d1a0b46e54983e09e0be8f89f9fac0ee74046e4/lib/grunt/plugins.js#L336\r\n\r\n\r\n\r\n\r\n\r\n"}}