Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell NPM install was successful

Tags:

npm

How can I make sure this package is completely successfully installed?

Whenever I install a package in NPM I see no error, no successful message.

Maybe I'm little hypochondriac :)

enter image description here

like image 677
Aladdin Mhemed Avatar asked Feb 08 '14 03:02

Aladdin Mhemed


People also ask

How do you check if npm install is successful or not?

To see if NPM is installed, type npm -v in Terminal. This should print the version number so you'll see something like this 1.4. 28. Create a test file and run it.

What happens after npm install?

npm install downloads a package and it's dependencies. npm install can be run with or without arguments. When run without arguments, npm install downloads dependencies defined in a package. json file and generates a node_modules folder with the installed modules.

How much time npm install takes?

It takes us something like 25 minutes to get a master build done. In that process, npm install takes 16 minutes alone. Why is it that bad? The root cause is that npm , node and javascript motto of single responsibility principle leads to dependency hell and spaghetti effect.

What happens if you npm install without -- save?

Optional dependencies are those packages which are only used when a particular feature of the application is used and will not be required if that functionality isn't used. –no-save: When this command is used with npm install it will not allow the installed packages from being saved into the dependency section.


1 Answers

When your npm module has been installed successfully your last line should show installed module name and version: <name>@<version>, installed directory and the installed module dependencies.

In your case mongojs has been installed successfully and you can see output as follows:

...
[email protected] node_modules/mongojs
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected])

In case of installation errors you should see some error messages. Also the same information should be stored in npm-debug.log file, created in the current directory.

If I install npm install [email protected] (that version of mongojs does not exits yet so I will not be able to install it successfully) I will get some errors:

npm errors

I hope that will help.

like image 143
Tom Avatar answered Sep 27 '22 17:09

Tom