{"id":2322,"date":"2015-10-17T12:38:18","date_gmt":"2015-10-17T10:38:18","guid":{"rendered":"https:\/\/adrhc.go.ro\/wordpress\/?p=2322"},"modified":"2015-10-17T17:16:59","modified_gmt":"2015-10-17T15:16:59","slug":"angularjs-errors","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/angularjs-errors\/","title":{"rendered":"angularjs errors"},"content":{"rendered":"<pre class=\"brush:bash shell;toolbar: false\">\r\n# error (e.g. in project named projectx)\r\nRunning \"imagemin:dist\" (imagemin) task\r\nFatal error: Cannot read property 'contents' of undefined\r\n# solution 1\r\nremove node_modules\/grunt-contrib-imagemin from projectx\r\ncopy node_modules\/grunt-contrib-imagemin to projectx from another working project\r\nrun again grunt build\r\n# solution 2\r\ncomment imagemin in Gruntfile.js:\r\ndist: [\r\n\/\/    'imagemin',\r\n\r\n# error\r\nImages are optimized and renamed to something like 8c5d3fdb.logout-16x16.png but not in html too (they are still referenced as e.g. logout-16x16.png).\r\n# solution 1\r\nPatch node_modules\\grunt-usemin\\lib\\htmlprocessor.js:\r\nif (srcfile !== file) {\r\n  self.log(match + ' changed to ' + res);\r\n}\r\nwhile(res.indexOf('..\/images\/') > -1){\t\r\n\tres = res.replace(\"..\/\",\"\");\r\n}\r\nreturn res\r\n# solution 2 (srcFile might be srcfile)\r\nPatch node_modules\\grunt-usemin\\lib\\fileprocessor.js:\r\nvar srcFile = filterIn(src);\t-> already exisnting line\r\ndebug('Let\\'s replace ' + src);\r\nwhile(srcFile.indexOf('..\/images\/') > -1){\t\r\n\tsrcFile = srcFile.replace(\"..\/\",\"\");\r\n};\r\ndebug('Looking for revved version of ' + srcFile + ' in ', assetSearchPath);\r\n\r\n# error (when running \"npm install\" in project dir)\r\nnpm ERR! Error: EACCES, mkdir '\/********\/.npm\/minimatch\/1.0.0'\r\nnpm ERR!     at Error (native)\r\nnpm ERR!  { [Error: EACCES, mkdir '\/********\/.npm\/minimatch\/1.0.0']\r\nnpm ERR!   errno: -13,\r\n# solution\r\nRun as administrator:\r\nsudo npm install\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p># error (e.g. in project named projectx) Running &#8220;imagemin:dist&#8221; (imagemin) task Fatal error: Cannot read property &#8216;contents&#8217; of undefined # solution 1 remove node_modules\/grunt-contrib-imagemin from projectx copy node_modules\/grunt-contrib-imagemin to projectx from another working project run again grunt build # solution [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/angularjs-errors\/#more-2322\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">angularjs errors<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-2322","post","type-post","status-publish","format-standard","hentry","category-howto"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/2322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=2322"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/2322\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=2322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=2322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=2322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}