npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

NPM not installing properly through my cloud9 terminal

I tried installing an NPM code from my terminal using the “npm install” command, yet it’s not responding properly.
I have attached a screenshot of the message am receiving whenever I tried installing NPM.

From the screenshot, npm seems to be fine but it’s not creating the node_module folder and even when I tried using the “ls” command to see through the folder, node module is still not showing up as you can also see in the screenshot.

When you type npm install it looks for a package.json file.

I am not sure how you made IntroToNpm but maybe you need to change directory into the DemoApp folder before running npm install?

You can get walked through the process of creating a package.json file using npm init.

And as for where cat-me went, I am guessing you have a mode_modules folder in your home directory and it got installed there.

npm looks for the project root from the current directory:

Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a package.json file, or a node_modules folder. If such a thing is found, then that is treated as the effective “current directory” for the purpose of running npm commands. (This behavior is inspired by and similar to git’s .git-folder seeking logic when running git commands in a working dir.)

If no package root is found, then the current folder is used.

Thank you so much Sir. It’s working perfectly well…you’ve really delivered me from a 4 days problem.