{"id":2518,"date":"2019-06-07T12:33:50","date_gmt":"2019-06-07T00:33:50","guid":{"rendered":"http:\/\/www.talkcrypto.org\/blog\/?p=2518"},"modified":"2020-07-09T13:11:06","modified_gmt":"2020-07-09T01:11:06","slug":"tutorialtoken1-0-0-dev-lite-server","status":"publish","type":"post","link":"https:\/\/www.talkcrypto.org\/blog\/2019\/06\/07\/tutorialtoken1-0-0-dev-lite-server\/","title":{"rendered":"tutorialtoken@1.0.0 dev: `lite-server`"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you are going through the <a href=\"https:\/\/www.trufflesuite.com\/tutorials\/robust-smart-contracts-with-openzeppelin\">Truffle TokenTutorial smart contract <\/a>and you can&#8217;t run &#8220;npm run dev&#8221; because you get the following error below, it can be very frustrating. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You follow all the instructions to the letter but get this strange error such as: &#8211; Cannot find module &#8216;..\/lib\/lite-server&#8217;<br>&#8211; ERR! code ELIFECYCLE<br>&#8211; ERR! tutorialtoken@1.0.0 dev: `lite-server`<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Seans-MacBook-Pro:tokentutorial sean$ npm run dev\n\n> tutorialtoken@1.0.0 dev \/Users\/sean\/Dropbox\/CodeDropBox\/truffle\/tokentutorial\n> lite-server\n\ninternal\/modules\/cjs\/loader.js:626\n    throw err;\n    ^\n\nError: Cannot find module '..\/lib\/lite-server'\nRequire stack:\n- \/Users\/sean\/Dropbox\/CodeDropBox\/truffle\/tokentutorial\/node_modules\/.bin\/lite-server\n    at Function.Module._resolveFilename (internal\/modules\/cjs\/loader.js:623:15)\n    at Function.Module._load (internal\/modules\/cjs\/loader.js:527:27)\n    at Module.require (internal\/modules\/cjs\/loader.js:681:19)\n    at require (internal\/modules\/cjs\/helpers.js:16:16)\n    at Object.<anonymous> (\/Users\/sean\/Dropbox\/CodeDropBox\/truffle\/tokentutorial\/node_modules\/.bin\/lite-server:7:1)\n    at Module._compile (internal\/modules\/cjs\/loader.js:774:30)\n    at Object.Module._extensions..js (internal\/modules\/cjs\/loader.js:785:10)\n    at Module.load (internal\/modules\/cjs\/loader.js:641:32)\n    at Function.Module._load (internal\/modules\/cjs\/loader.js:556:12)\n    at Function.Module.runMain (internal\/modules\/cjs\/loader.js:837:10) {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: [\n    '\/Users\/sean\/Dropbox\/CodeDropBox\/truffle\/tokentutorial\/node_modules\/.bin\/lite-server'\n  ]\n}\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! tutorialtoken@1.0.0 dev: `lite-server`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the tutorialtoken@1.0.0 dev script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     \/Users\/sean\/.npm\/_logs\/2019-06-09T09_13_38_647Z-debug.log\n\n\nhttps:\/\/github.com\/node-inspector\/node-inspector\/issues\/1044<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As with most computer problems, when all else fails, restart from the beginning. Here, a clean install of npm resolved this issue for me. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, delete the node_module folder in your project directory and also the package-lock.json file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"838\" height=\"738\" src=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-10.31.16-am.png\" alt=\"\" class=\"wp-image-2520\" srcset=\"https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-10.31.16-am.png 838w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-10.31.16-am-300x264.png 300w, https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/Screen-Shot-2019-06-10-at-10.31.16-am-768x676.png 768w\" sizes=\"(max-width: 838px) 100vw, 838px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then run npm install again. Now you should be able to run &#8220;npm run dev&#8221; successfully.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are going through the Truffle TokenTutorial smart contract<\/p>\n","protected":false},"author":1,"featured_media":2521,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2518","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ethereum"],"featured_image_urls":{"full":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm.jpg",300,130,false],"thumbnail":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm-150x130.jpg",150,130,true],"medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm-300x130.jpg",300,130,true],"medium_large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm.jpg",300,130,false],"large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm.jpg",300,130,false],"1536x1536":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm.jpg",300,130,false],"2048x2048":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm.jpg",300,130,false],"chromenews-featured":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm.jpg",300,130,false],"chromenews-large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm.jpg",300,130,false],"chromenews-medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2019\/06\/npm.jpg",300,130,false]},"author_info":{"info":["seandotau"]},"category_info":"<a href=\"https:\/\/www.talkcrypto.org\/blog\/category\/ethereum\/\" rel=\"category tag\">Ethereum<\/a>","tag_info":"Ethereum","comment_count":"0","_links":{"self":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/2518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/comments?post=2518"}],"version-history":[{"count":4,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/2518\/revisions"}],"predecessor-version":[{"id":2683,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/2518\/revisions\/2683"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media\/2521"}],"wp:attachment":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media?parent=2518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/categories?post=2518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/tags?post=2518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}