Hello all, Newbie in node.js. Reading a book and download projects to follow the text. I understand the primary role of index.js file is the entry point for a given project. But I have problems with this file. The first project in the book is to create a new directory (TestProject) and download and install a project using the command "npm install colors" in this directory. The book went on and show how to modify the index.js file.
After I ran the above command, a node_module folder is created in the root directory (TestProject) and no other files beside this node_module exist in the root directory. I attached screenshots for my questions. My question is where is index.js located? Should it be in the root directory (TestProject) of this project or at least in colors's folder where package.json is located (Path of Index.js 01.jpg)? Instead, I found an index.js file buried in the subdirectory, the lib folder, within the colors folder after the project was created (Path of Index.js 02.jpg). Is this normal? In more complicated project, there are lots of index.js files created for each dependent modules buried under node_module folder. For this simple module, I would expect the location of index.js should be in the root directory and not buried deep inside node_module's or colors' folder. But this root directory (TestProject) is empty. Not sure what is the problem or is this a problem at all. I am using Windows8, version of node.js is 4.4.7 (LTS version) and npm is 2.15.8. Could I be running into this bug: https://github.com/npm/npm/issues/5082 The above post said npm 2.15.8 should fix the missing index.js problem. Thanks in advance. Sorcerer -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/3f6b3f31-fb73-4b49-894f-40b6157bc186%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
