{"id":8036,"date":"2015-11-21T13:58:23","date_gmt":"2015-11-21T13:58:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/21\/cannot-find-module-winston-open-source-projects-winstonjs-winston\/"},"modified":"2022-08-30T15:03:03","modified_gmt":"2022-08-30T15:03:03","slug":"cannot-find-module-winston-open-source-projects-winstonjs-winston","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/21\/cannot-find-module-winston-open-source-projects-winstonjs-winston\/","title":{"rendered":"Cannot find module &#39;winston&#39;-open source projects winstonjs\/winston"},"content":{"rendered":"<p>I wrote a little module that uses winston to log stuff.<\/p>\n<p>I used <code>sudo npm install -g winston<\/code> (it is on a vm&#8230;so i&#8217;m not too concerned with sudo, etc.<\/p>\n<p>Log from npm:<\/p>\n<pre><code>winston@0.7.2 \/usr\/local\/lib\/node_modules\/winston\n\u251c\u2500\u2500 cycle@1.0.2\n\u251c\u2500\u2500 stack-trace@0.0.7\n\u251c\u2500\u2500 eyes@0.1.8\n\u251c\u2500\u2500 colors@0.6.2\n\u251c\u2500\u2500 async@0.2.9\n\u251c\u2500\u2500 pkginfo@0.3.0\n\u2514\u2500\u2500 request@2.16.6 (forever-agent@0.2.0, aws-sign@0.2.0, tunnel-agent@0.2.0, oauth-sign@0.2.0, json-stringify-safe@3.0.0, cookie-jar@0.2.0, node-uuid@1.4.1, mime@1.2.11, qs@0.5.6, hawk@0.10.2, form-data@0.0.10)\n<\/code><\/pre>\n<p>When I try to run my module in node I get:<\/p>\n<pre><code>Error: Cannot find module 'winston'\n    at Function.Module._resolveFilename (module.js:331:15)\n    at Function.Module._load (module.js:273:25)\n    at Module.require (module.js:357:17)\n    at require (module.js:373:17)\n    at Object. (\/home\/name\/Code\/neon\/neon-js-spike\/logger.js:2:9)\n    at Module._compile (module.js:449:26)\n    at Object.Module._extensions..js (module.js:467:10)\n    at Module.load (module.js:349:32)\n    at Function.Module._load (module.js:305:12)\n    at Module.require (module.js:357:17)\n<\/code><\/pre>\n<p>System versions: ubuntu node -v = v0.11.7-pre npm -v = 1.3.8<\/p>\n<p>P.S. I tried this on my home laptop (another ubuntu vm) and worked.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wrote a little module that uses winston to log stuff. I used sudo npm install -g winston (it is on a vm&#8230;so i&#8217;m not too concerned with sudo, etc. Log from npm: winston@0.7.2 \/usr\/local\/lib\/node_modules\/winston \u251c\u2500\u2500 cycle@1.0.2 \u251c\u2500\u2500 stack-trace@0.0.7 \u251c\u2500\u2500 eyes@0.1.8 \u251c\u2500\u2500 colors@0.6.2 \u251c\u2500\u2500 async@0.2.9 \u251c\u2500\u2500 pkginfo@0.3.0 \u2514\u2500\u2500 request@2.16.6 (forever-agent@0.2.0, aws-sign@0.2.0, tunnel-agent@0.2.0, oauth-sign@0.2.0, json-stringify-safe@3.0.0, cookie-jar@0.2.0, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8036","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=8036"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8036\/revisions"}],"predecessor-version":[{"id":8675,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8036\/revisions\/8675"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=8036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=8036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=8036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}