Error in configuring/installation of nodemon - node.js

I'm new to nodejs, I am having difficulties in setting up nodemon. I tried to install nodemon using the below command
npm install -g nodemon
But I get the below error,
npm WARN package.json methods#0.0.1 No repository field.
npm WARN package.json bytes#0.2.0 No repository field.
npm WARN package.json pause#0.0.1 No repository field.
npm WARN package.json send#0.1.0 No repository field.
npm WARN package.json range-parser#0.0.4 No repository field.
npm WARN package.json cookie-signature#1.0.1 No repository field.
npm WARN package.json fresh#0.1.0 No repository field.
How to solve this? And How do I configure nodemon to monitor changes to my files?

The messages you're getting are just warnings emitted by npm to warn that the installed package.json has no repository specified. This behavior of npm is quite new. See this github issue.
The good news is, you have nodemon installed successfully and you do not need to configure it but start it with some command line options. See the nodemon page for more information.
A simple usage example is
nodemon --watch routes app.js
Which starts app.js and watches the routes directory for changes.

Related

npm install suddenly fails

I have been able to install node modules locally in a project for quite some time. All of sudden ALL attempts at installation fail, with the same type of error:
Homers-MacBook-Pro:test homer$ npm install bootstrap#3
/Users/homer
└── bootstrap#3.3.7
npm WARN enoent ENOENT: no such file or directory, open '/Users/homer/package.json'
npm WARN homer No description
npm WARN homer No repository field.
npm WARN homer No README data
npm WARN homer No license field.
I'm not using a package.json file, just hoping to install some modules in a local node-modules directory. I don't understand why npm suddenly thinks it needs a package,json in my Home directory.
I'm on MacOS 10.12.4. There have been no upgrades in the system or in Node since the last successful npm install a couple of weeks ago.
This is just a warning, not errorwhich means you can ignore it. And your package has been successfully installed.
npm WARN homer No description // no description in package.json
npm WARN homer No repository field. // no repository setted in package.json
npm WARN homer No README data // no introcude md found
npm WARN homer No license field. // no lisence type setted in package.json
Above warn messages is all about details of package.json which were caused by package.json not found.
package.json is a config file which stores libraries that you installed by npm. So that you don't have to copy/manage these libraries manually and locally.
Next time for a new environment, you can simply reprocude the denpendencies by npm install, and npm will read your package.json and reinstall packages stored in it.
As commented by #peteb (thanks again), while install packages via npm install [packages], npm will try to check whether your newly installed package is listed in package.json . If the file doesn't exist, then this warn message will be shown.

npm install error after installing nodejs

I have a problem to install the npm, These are my errors, there are lot of errors , but i paste some of these here, please tell me what should i do?I have already installed nodejs , mongodb and all..
npm WARN package.json hublin#0.1.0 No repository field.
npm WARN package.json awesome-collaborative-editor#1.0.0 No description
npm WARN package.json awesome-module#1.0.0 No README data
npm WARN package.json awesome-yjs#0.0.0 No description
npm WARN package.json chokidar#1.5.1 No README data
npm WARN package.json karma-mocha#0.1.1 No README data
npm WARN package.json karma-phantomjs-launcher#0.1.4 No README data
npm WARN package.json karma-rawfixtures-preprocessor#0.0.1 No repository field.
npm WARN package.json om-email-invitation#0.0.3 No README data
npm WARN package.json om-invitation#0.0.2 No README data
npm WARN package.json om-mailer#0.0.1 No README data
npm WARN package.json trim#0.0.1 No repository field.

NPM Warnings - "... is also the name of a node core module."

My Node app constantly displays the following warnings when running npm install, or installing new modules. Am I declaring these modules unnecessarily somewhere or is this expected behaviour?
npm WARN package.json fs#0.0.2 fs is also the name of a node core module.
npm WARN package.json fs#0.0.2 No description
npm WARN package.json fs#0.0.2 No repository field.
npm WARN package.json fs#0.0.2 No README data
npm WARN package.json http#0.0.0 http is also the name of a node core module.
npm WARN package.json http#0.0.0 No description
npm WARN package.json http#0.0.0 No repository field.
npm WARN package.json http#0.0.0 No README data
npm WARN package.json querystring#0.2.0 querystring is also the name of a node core module.
These are things that can be done to fix
Uninstall fs & reinstall fs
npm cache clean
Delete node_modules folder and rerun npm install

npm list not returning package paths

npm has started to seriously under perform recently, I have attempted to re install ghost a number of times but since installing it to its current location npm cant find its path.
I enter the below from /home/usr
$ npm list ghost --parseable
$ npm list express --parseable
$
and again in /node_modules I then get the below.
pi#raspberrypi://home/pi/node_modules$ npm list ghost --parseable
npm WARN package.json has-binary-data#0.1.1 No repository field.
npm WARN package.json socket.io-adapter#0.2.0 No repository field.
npm WARN package.json debug#0.6.0 No repository field.
npm WARN package.json bind#0.0.1 No repository field.
npm WARN package.json emitter#1.0.1 No repository field.
npm WARN package.json indexof#0.0.1 No repository field.
npm WARN package.json object-component#0.0.3 No repository field.
npm WARN package.json parseuri#0.0.2 No repository field.
npm WARN package.json parsejson#0.0.1 No repository field.
npm WARN package.json parseqs#0.0.2 No repository field.
npm WARN package.json better-assert#1.0.0 No repository field.
npm WARN package.json callsite#1.0.0 No repository field.
Am I right in thinking npm has lost the path to the above package.json files?

How to execute 'coffee' command after installation?

I installed coffee-script as per directions.
$ npm install http://github.com/jashkenas/coffee-script/tarball/master
npm http GET http://github.com/jashkenas/coffee-script/tarball/master
npm http 200 http://github.com/jashkenas/coffee-script/tarball/master
npm http GET https://registry.npmjs.org/mkdirp
npm http 200 https://registry.npmjs.org/mkdirp
npm WARN package.json cookie-signature#1.0.0 No repository field.
npm WARN package.json fresh#0.1.0 No repository field.
npm WARN package.json methods#0.0.1 No repository field.
npm WARN package.json range-parser#0.0.4 No repository field.
npm WARN package.json send#0.1.0 No repository field.
npm WARN package.json ms#0.1.0 No repository field.
npm WARN package.json pause#0.0.1 No repository field.
npm WARN package.json bytes#0.2.0 No repository field.
npm WARN package.json formidable#1.0.11 No repository field.
npm WARN package.json css#1.0.8 No repository field.
npm WARN package.json uglify-js#2.2.5 'repositories' (plural) Not supported.
npm WARN package.json Please pick one as the 'repository' field
npm WARN package.json walk#2.2.1 No repository field.
npm WARN package.json css-parse#1.0.4 No repository field.
npm WARN package.json css-stringify#1.0.5 No repository field.
coffee-script#1.6.3 node_modules/coffee-script
└── mkdirp#0.3.5
yet when i execute 'coffee' command i get
$ coffee
-bash: coffee: command not found
What am i doing wrong?
PS: i am doing this on Mac Terminal
EDIT: -
Same problem is occurs when i install nodemon the npm install takes place similar to above. But when i input a nodemon command on $ prompt it says -bash: nodemon: command not found
I installed coffeescript on my mac yeasterday as a matter of fact. Here is how I did it:
First of all, go install NodeJS.
Then go in Terminal and type the following: sudo npm install -g coffee-script
That's it - If you type in coffee in Terminal, it should start without a problem
Anything you want to run as a command (nodemon, coffee, node-inspector) must be installed with npm install -g the-package-name. If you use npm install it just puts it into your local node_modules directory and won't create the symlink for command line execution.
If you find that you need to use sudo, you might want to read this blog post: http://howtonode.org/introduction-to-npm:
what, no sudo?
I strongly encourage you not to do package management
with sudo! Packages can run arbitrary scripts, which makes sudoing a
package manager command as safe as a chainsaw haircut. Sure, it's fast
and definitely going to cut through any obstacles, but you might
actually want that obstacle to stay there.
I recommend doing this once instead:
sudo chown -R $USER /usr/local

Resources