FAQ Database Discussion Community


npm start fails because of [email protected] ELIFECYCLE

node.js,osx,npm
I have a problem starting a node.js server. The server app was tested on another system and worked perfectly. The error log says that something is wrong with the [email protected] but I was not able to find any solution. 0 info it worked if it ends with ok 1 verbose...

Grunt tasks stuck in endless loop

javascript,node.js,gruntjs,npm,grunt-contrib-concat
Working on putting together a base Gruntfile.js for some upcoming projects. Starting in on a new computer so everything has been a fresh build. Installed Node and NPM using Homebrew, and then installed Grunt globally, as well as in my local directory. Here is my package.json: { "name": "timespent-prototype", "version":...

How to use curly brackets in npm scripts?

node.js,npm,mkdir
I want to run this simple command in an npm script called prepare_build: ... scripts: { "prepare_build" : "mkdir -p dist/lib/{js,css}" } ... running npm run prepare_build would create a single directory dist/lib/{js,css} whereas running the command in the console would create both dist/lib/js and dist/lib/css. What am I doing...

In Meteor: How to use a npm library that should be pulled from a repository?

node.js,meteor,npm
In my packages.json file, I have: { "sendwithus":"git+https://[email protected]/whalepath/sendwithus_nodejs.git#enable_testing_server" } because I need to use a forked ( and fixed version of the library). The above syntax works in straight node. How to do this in meteor? This is the error I get: => Started proxy. => Errors prevented startup: While...

ionic build ios fails with “[TypeError: Arguments to path.join must be strings]”

ios,node.js,npm,cross-platform,ionic-framework
I am trying to create an ionic app on Mac. I followed the instructions on ionic's website to create a basic app and was able to run it in the browser but when I run "ionic build ios" I get following error. I cannot find a log file or any...

Hosting my MEAN stack web app on github pages

node.js,express,github,npm,gh-pages
I have a project here that is on github. I created a gh-pages branch to make it hosted on github pages. The link they gave me to my hosted site is here. I am pretty new to web apps and especially new to MEAN stack web apps. My question is...

NPM Error Parsing Json, Unexpected Token

json,node.js,npm
I'm trying to install grunt, but no luck. npm install -g grunt-cli --registry http://registry.npmjs.org/ gives this error: npm ERR! registry error parsing json npm ERR! Darwin 14.3.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli" "--registry" "http://registry.npmjs.org/" npm ERR! node v0.12.4 npm ERR! npm v2.10.1 npm ERR! Unexpected token <...

Can “.htaccess” file work with npm's “http-server” command?

.htaccess,npm,httpserver
This is probably a rookie question, but although the npm http-server page states: ...http-server is a simple, zero-configuration command-line http server... Does this mean it completely disregards an .htaccess file? If so, is there another (yet still simple to use) HTTP server alternative that reads and uses it?...

jquery appears in browserify bundle.js but not working in browser

javascript,jquery,node.js,npm,browserify
I'm following this short tutorial on getting started with Browserify Getting Started with Browserify. Despite following everything exactly jquery isn't working on the page when bundled,ie. the button element in my app.js code below is not appended to the body. Have checked everything I can think of using chrome dev...

docker build + private NPM (+ private docker hub)

node.js,npm,docker,docker-registry
I have an application which runs in a Docker container. It requires some private modules from the company's private NPM registry (Sinopia), and accessing these requires user authentication. The Dockerfile is FROM iojs:latest. I have tried: 1) creating an .npmrc file in the project root, this actually makes no difference...

grunt-bower-install won't include my css files

javascript,gruntjs,npm,bower
I'm quite new to bower and grunt, so basic things work bad for me. I've bower install --save bootstrap and want grunt-bower-install to update my js & css files, according to documentation It works great with the .js files, and I have successfully updated my index.html <!-- bower:js --> <script...

VS 2015 RC - Trying to fetch local plugin from remote registry

node.js,npm,cordova-plugins,visual-studio-cordova,plugman
I have a local plugin, which I'm trying to install to a Cordova project. Adding it through VS works like a charm, but when I'm building it, plugman tries to retrieve the plugin from the registry (npm http GET http://registry.cordova.io/[Plugin]/[Version]) and the build fails, because this plugin only exist locally....

lodash npm distribution in browser

npm,karma-runner,bower,lodash
I'm using lodash in my tests, Not using webpack or browserify (don't need to). I found that the default npm build differs from what's in bower. I could of course use bower version, but I'm curious if I can use npm's instead (it's already there for Gulp). For bower I...

sass file not compiled by gulp

css,node.js,sass,npm,gulp
I want to switch from less to sass so I installed gulp-sass with npm and modified my gulpfile to compile sass instead of less (nothing else changed). Sadly gulp doesn't compile my .scss file to css and after googling and trying all i could think of it still doesn't compile....

How to start node server and export NODE_PATH (with npm start or inline command)

node.js,shell,command-line,npm,package.json
Before starting the server, I need to export ('set' actualy, I'm using Win7) NODE_PATH variable. I tried to do it with this command (not working even in command line): set NODE_PATH=./ && node server.js and for package.json: "scripts": { "start": "set NODE_PATH=. && node server.js" }, But it's not working....

Error CordovaModuleLoadError - multi device hybird app in visual studio

ios,git,cordova,npm,visual-studio-cordova
I am following the steps here and here to build and simulate a multi device hybird app in ios. I followed the steps in the articles and I can see that when I run my multi device hybird app in visual studio using iphone simulator as the run target, the...

Use existing JS “package” with Node.JS?

javascript,node.js,npm
I have some existing JS code which I am releasing as an NPM package. Let's call it "my-pkg". I've created the package.json and installed my new local package. My package consists of these files: my-pkg.js package.json my-pkg.js function ping() { console.log("Hi!"); } package.json { "name": "my-pkg", "version": "1.0.0", "description": "My...

cant install ionic-service-deploy

npm,ionic-framework,bower,ionic
I am using ionic and wanted to add deploy option to my code but cant install ionic-service-deploy I am trying to run ionic add ionic-service-deploy but getting error: > Failed to find the bower component "ionic-service-deploy". Are you sure it exists? (CLI v1.4.5) Your system information: Cordova CLI: 5.0.0 Ionic...

npm doesn't honor git's “insteadOf” config when cloning from mirrors

node.js,npm
I have set up the following command to prevent npm from downloading NPM packages with the GIT protocol, as it is somehow blocked by my server : git config --global url."https://github.com/".insteadOf [email protected] However, when running npm install, an error still occurs because a package tries to use the Git protocol,...

NPM install -g cordova ionic gives Err -13

node.js,cordova,npm,ionic,hybrid-mobile-app
I am trying to install ionic (or anything) with npm, and am getting errors everytime. Below is a copy of the error I get when trying to install ionic. I have already tried uninstall/reinstall, but getting the same issue. npm ERR! tar.unpack untar error /Users/csutaria/.npm/ionic/1.4.5/package.tgz npm ERR! Darwin 14.3.0 npm...

how to integrate a lodash custom build into a project

npm,browserify,lodash,package.json
lodash supports custom builds with only a subset of the functionality / size. Creating a custom build is a breeze with lodash-cli. What's the recommended way to take this custom build and integrate it into the project? (using npm / browserify). Do I create a custom build command that creates...

can I connect nodejs with teradata (any nodejs npm for this)?

node.js,jdbc,npm,teradata
Is there anyway I can connect teradata to nodejs server? I have use case where I need to pull teradata information in my rest APIs. Can I use this npm package?...

npm install: 'bower install' exited with error code 1

node.js,powershell,npm,bower
I want to programm widgets for XBee ZigBee Cloud Kit. To do it, I need first to set up everything. I'm using this guide. After failing repeatedly the automated setup I started the Manual setup. I did install the Requirements. So everything so far went good until the last point:...

What is the correct way of adding a dependency to react in your package.json for a react component

node.js,npm,reactjs
I have made a few simple reusable react components and wanted to know the correct way to include a dependency to react in my package.json for publishing with npm. I am currently doing this: Assuming my component will use the most recent version of react and I have tested and...

pm2 list command displaying badly formatted results

node.js,ubuntu,npm,pm2
I've been playing around with pm2 for the first time on a remote Ubuntu instance. It seems to be running fine but when I list the running processes using pm2 list the formatting of the table is a bit messed up. It's not a big deal as everything appears to...

Node.js app giving ERR_EMPTY_RESPONSE

javascript,node.js,mongodb,npm
I'm having serious issues with an app I am building with Node.js, Express, MongoDB and Mongoose. Last night everything seemed to work when I used nodemon server.js to `run the server. On the command line everything seems to be working but on the browser (in particular Chrome) I get the...

running npm install unbuilds global npm

node.js,npm,nodegit
I have a project that depends on nodegit. When I run npm install -g . I get this output at some point: When npm finishes installing, I lose access to it in the path: I end up having to run 'n', to change to a previous version of node, then...

npm install vs. edit package.json and npm update

node.js,npm
Curious what is the difference between the two procedures: npm install xyz edit package.json, adding required module names like this: "dependencies": { "express": "~3.4.4", "mongodb": "*", "body-parser": "*", "bson": "*" }, and then npm update...

locating path of a file in meteorjs

javascript,node.js,meteor,coffeescript,npm
I have a project in meteorjs that is using the nodes filesystem to read file, but I am not able to locate the file to be read. My file Location Server - startup - app.load.coffee - myfileToBeRead.txt My try in app.load.coffee fs = Npm.require('fs') console.log fs.readFileSync 'server/startup/myfileToBeRead.txt' I am not...

Jenkins build step fails when calling “npm” on mac-os-x Yosemite

node.js,osx,jenkins,npm,vagrant
Before I start, I want to say that I already checked these answers: Jenkins build step fails on 'npm install <whatever>' Jenkin's build failing on npm install Now, I'm dealing with this issue for a while already and thus I tried a bunch of stuff. Firstly, I installed node +...

Why doesn't a command that works inside a docker container work from outside via docker run?

linux,npm,docker,circleci,linux-containers
I have a container called my_container when I run docker run -i -t my_container I can then run npm --version and I get 2.7.4. However when I try to run the same command from outside the container using docker run --workdir=/home/ubuntu/www my_container npm --version I get an error message: Unable...

node user model is vomitting

node.js,express,npm
I am trying to get my hands dirty with making node api following this tutorial https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens problem is that when I execute $ nodejs server.js I get this error { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version {...

NodeJs npm WARN uninstall not installed in $HOME/node_modules

linux,node.js,module,npm,uninstall
I have NodeJs module installed on /usr/lib/node_modules/ If i want to uninstall: $ npm remove <module> I get this error message: npm WARN uninstall not installed in /home/<user>/node_modules: "<module>" OS: Manjaro Linux / 0.8.13rc1 / Ascella / XFCE Thanks!...

Is it possible to install npm package only if it has not been already installed?

node.js,bash,npm,circleci
Is it possible to install npm package only if it has not been already installed? I need this to speed up test on CircleCI, but when I run npm install [email protected] etc. it always downloads things and installs them from scracth, however, node_modules folder with all modules is already present...

404 on api authenticate for node restful

node.js,express,npm
I am using this tutorial https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens to learn about node with restful authentication. I am getting 404s in the route when I post at this http://localhost:8090/api/authenticate Here is the response that I get Cannot POST /api/authenticate and the console shows 404 POST /api/authenticate 404 2.465 ms - 30 here is...

npm's guidelines on callback errors

javascript,asynchronous,error-handling,callback,npm
I was reading through npm’s coding style guidelines and came across the following very cryptic suggestion: Be very careful never to ever ever throw anything. It’s worse than useless. Just send the error message back as the first argument to the callback. What exactly do they mean and how does...

NPM Error: self signed certificate in certificate chain

ssl,npm,tsd
I am following the Angular 2 quick start guide and I'm stuck right at the beginning of it. My company is filtering our network connections and modifying SSL negociation. In a man in the middle style they assign a self signed certificate as the CA of the destination's certificate. Therefore...

Error: EMFILE: too many open files

javascript,node.js,request,npm
Using nw.js, I am just trying to save images in an array of img elements with different random names. But having a few errors, is something wrong with my code? for (i = 0; i < imgs.length; i++) { request(imgs[i].getAttribute('src')).on('error', function(err) { throw err }).pipe(fs.createWriteStream('data/imgs/' + randomString)) } imgs[] is...

automate npm update,bower prune, bower update inside gulpfile as gulp tasks

npm,gulp
I want to automate my gulpfile with the following tasks(gulp.task). npm update bower prune bower update Every time anyone changes package.json and bower.json, I just run gulp and the packages get installed/updated/deleted without having to run these commands through terminal....

Get an array of file names without extensions from a directory in Gulp?

npm,gulp
I want to get each of the file names in 2 directories (helpers/ and dialogs/) into an array without the file extension using Gulp and/or NPM. Note that the array will be pre-populated with values - I need to append the file names to this array. In other words, my...

MongoDB : querying documents with two equal fields, $match and $eq

database,node.js,mongodb,npm,aggregation-framework
What is the best way to return all documents in a collection if I want document.a == document.b? I've tried db.collection.aggregate([ { $match: { $eq: [ '$a', '$b' ] } }]) But it returns with no errors or results, because I assume it is literally matching strings "$a" and "$b"....

-bash: grunt: command not found

node.js,osx,bash,gruntjs,npm
I was using node 0.10.35 and grunt command was working fine. Now after upgrading to 0.12.3 grunt command has stopped working. OS: Mac OSX 10.10.1 node: 0.12.3 npm: 2.9.1 grunt: 0.4.5 I thought there may be problem in node installation, so I clean installed it 3-4 times I tried installing...

`npm uninstall` hangs (or very slow) without apparent activity

linux,node.js,npm,rmdir,openafs
I've always found npm uninstall to take a surprisingly long time and am trying to troubleshoot. I started an uninstall of four packages ~25 minutes ago, and it appears stalled with no progress, no significant CPU activity, and no apparent disk activity (using iotop). I'm at a loss for what...

NPM cluster module and listening on different ports

node.js,express,npm
I see a lot of examples of using the cluster npm module with Express web servers. For example: http://rowanmanning.com/posts/node-cluster-and-express/ However, if you create a new web server for each core using the cluster module, doesn't each instance have to listen on a different port? Most of the examples I see...

Shell script wrappers for npm packages that are command line programs

node.js,npm
Suppose you have an npm package that you want to be usable as a command line program, e.g. js-beautify. When I install this globally, I see that there is indeed a Windows batch file that comes with it, in fact two slightly different batch files with the same name in...

Error when i try to install npm with putty

amazon-ec2,npm,install,runtime-error
here is what i get when i try to execute this command (the 3rd command - in ec2 amazon) The next step is to install NPM(Node package manager). Type the following commands: 1. git clone https://github.com/isaacs/npm.git 2. cd npm **3. sudo make install** and here is the error i get:...

Created a package.json file, but getting dependency errors when running npm install

javascript,json,node.js,npm
I know this is a common question and I tried researching on here, but none of the answers have seemed to help me thus far. I am following this tutorial to learn node, and after I try to install the package.json I received the following errors: npm ERR! install Couldn't...

Strange npm behavior when installing packages like grunt

node.js,gruntjs,npm,gulp,bower
I run the following command in my bash and I get the related results: [email protected]:~$ sudo npm install -g grunt-cli /usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt [email protected] /usr/local/lib/node_modules/grunt-cli ├── [email protected] ├── [email protected] ([email protected]) └── [email protected] ([email protected], [email protected]) and [email protected]:~$ grunt /usr/bin/env: node: No such file or directory I also have try to install...

Node.js-Express-Strompath No CustomData after immediately after registration

node.js,express,npm,stormpath
I am having a strange error (at least in my opinion) after registering a user to stormpath via node/express using the Express-Stormpath module. Just after registering I seem to have no access to customData in various routes for just the first user session. On registration I am creating and array...

error Failed at the [email protected] install script 'node-gyp rebuild'

node.js,npm,bcrypt,node-gyp
I'm trying to install bcrypt on my laptop, Windows 7 64bit. I have already installed Microsoft Visual C++ 2008 Redistributable Package, 2012 Redistributable package. Also installed Visual Studio 2013 community with update 4. Im trying to add node module with this command npm install bcrypt --msvs_version=2013 into my nodejs project...

MeteorHacks:npm not working ( npm modules in Meteor)

node.js,meteor,npm
I have installed MeterorHacks Npm and I added two packages in the .json file : { "cheerio":"0.19.0", "request":"2.57.0" } I have put the required node packages in public directory of meteor. When I use meteor command, the error I get in cmd is : It just stops at Building npm-container...

NPM repo missing file

ember.js,npm,ember-cli
I have a git repo for an Ember Addon: https://github.com/lifegadget/ui-responsive-toolbelt It passes all unit tests. It has been published to npm as ui-responsive-toolbelt. I have used npm's "link" functionality to test locally that this "addon" (in Ember parlance) works fine in consuming application when included in the package.json file as...

Failing to create package with manifoldjs

javascript,npm
I am eager to try out the new ManifoldJS that Microsoft announced at Build 2015, but I am struggling. I have put up a basic site on http://powertalks.azurewebsites.net/. It is a HTML- and JS- app using Angular and TypeScript. I have also published a manifest.json file, so all should be...

Is there a fast way to figure out the source of all dependencies in my node.js / npm project?

node.js,dependencies,npm
npm is capable of installing dependencies from the official npm registry, git urls, HTTP urls, and other sources. Is there a fast way to recursively determine where all of the dependencies in my project came from? Basically I need to make sure that all of my dependencies are coming form...

Node Global Install Error

javascript,node.js,npm
I'm trying to make a Node module that, when installed with -g, will run by a single command from a terminal. All tutorials show its pretty straightforward, so I don't know what I'm missing. Here's what I've done: Package.json: ... "bin": { "myapp": "./lib/myapp.js" }, ... npm publish npm install...

CordovaModuleLoadError [ '4.3.0' ] - multi device hybird app in visual studio

ios,cordova,npm,visual-studio-cordova
This is a follow up question after I attempted to fix this issue. I now have Visual Studio 2015 with the associated tools for Apache Cordova, but I am still unable to run multi device hybrid app in ios simulator. I created a new blank Cordova project and I am...

ClojureScript Node.js REPL issue

npm,clojurescript
I'm following the instructions to run ClojureScript Node.js REPL: https://github.com/clojure/clojurescript/wiki/Quick-Start Everything works fine, but in the "Node.js REPL" section, I got the errors with rlwrap java -cp cljs.jar:src clojure.main node_repl.clj. node.js> rlwrap java -cp cljs.jar:src clojure.main node_repl.clj Exception in thread "main" java.io.FileNotFoundException: Could not locate cljs/build__init.class or cljs/build.clj on classpath.,...

npm install, node-gyp build error on only one of two identical machines

node.js,ubuntu,jenkins,npm
I'm trying to run npm install on an Ubuntu 14.04 VPS but it keeps failing on installing karma. The command npm install is executed from a Jenkins build step but also fails from the command line when I log in as jenkins user. The Jenkins server invokes a deployment through...

Error running jest react test, jest not recognized

npm,reactjs,jestjs
I'm trying to run some jest tests but keep getting the error: 'jest' is not recognized as an internal or external command, operable program or batch file. Here is my package.json, can anyone please help get my test framework setup? { "name": "lac-react", "version": "0.0.0", "description": "", "main": "index.js", "scripts":...

Nodejs : peerDependencies error while installing depedencNodejs

node.js,npm,karma-runner,karma-jasmine
In my attempt to get the libraries I need, npm install was working well till about a year and now as I move to a new server it breaks stating PeerDependencies error. I am kind of confused as I fail the reason for which the code is breaking, has any...

Using npm to install grunt on nodeenv results in findup-sync error

node.js,gruntjs,npm
After establishing a node virtualenv using nodeenv, I use source /bin/activate to switch into the correct directory, update npm, and execute npm install -g grunt or npm install -g grunt-cli and I recieve the same error: npm ERR! Linux 3.13.0-53-generic npm ERR! argv "node" "/home/{redacted-home-dir}/NodeProjects/vue/bin/npm" "install" "-g" "grunt-cli" npm ERR!...

npm install not finding package installed

node.js,npm,yeoman-generator
I am installing a generator-phonegap that request the packaged phonegap that it is not finding. BUT I KNOW that is installed! I tried to install globally C:>npm install -g generator-phonegap and that is the error: npm ERR! notarget No compatible version found: [email protected]'>=3.1.0 <3.2.0' npm ERR! notarget Valid install targets:...

Combine js files from different directories via config using grunt

javascript,gruntjs,npm,minify
I'm using grunt and sass and I'm looking for a sass-like feature to import any JS file I like to and combine them to 1 file via some config depending on the directory I am in. Example directories: startpage file1.js file2.js importjs.json page1 file3.js file4.js importjs.json global global1.js global2.js Each...

jsx command not found on mac terminal

node.js,npm,reactjs,jsx
Problem: I execute the following command from the macintosh terminal: $ jsx --watch src/ build/ I recieve the following output error from the terminal: -bash: jsx: command not found Relevant information: I am following the following tutorial: https://facebook.github.io/react/docs/getting-started.html I executed the following command from the tutorial with positive output: $...

Package.json not found error when updating using npm-check-updates

node.js,npm,package.json
I'm trying to update my node packages/modules and a lot of people (many from StackOverflow) recommended 'npm-check-updates' so I downloaded via npm and ran it. It gave me this error and I'm not sure what's wrong. Is something wrong with my PATH variable in system settings or something? I can't...

What is the meaning of npm view dependencies output?

node.js,npm
When executing npm view [email protected] dependencies the dependencies are not displayed uniformly. What does it mean if a dependency is marked with a single quote and green font? What does it mean if a dependency is in a white font? ...

is request (HTTP Request client) synchronous?

node.js,npm
Request is for http post and get . I am a newbie to node.js. Please help me know if it is synchronous or asynchronous . https://www.npmjs.com/package/request...

How to find the version of module in Node Js

node.js,npm
I'm having a problem, I installed a module but I want to know the version so I can added to the package json of my project.

Node JS NPM modules installed but command not recognized

node.js,npm,bower
Node JS and NPM was working well before. Recently I have re-installed the Node JS, NPM and the problem started. After I install a module like example npm install -g bower, the module gets installed successfully but bower -v gives 'bower' is not recognized as an internal or external command,...

Error while updating to latest pm2

node.js,npm,pm2
I tried updating pm2 with "npm install [email protected] -g" (Cent OS 6) but received the following error. Now, i am no longer able to use "pm2 list" (it says command not found). Your help will be highly appreciated. npm ERR! Linux 2.6.32-042stab094.8 npm ERR! argv "node" "/home/username/local/bin/npm" "install" "pm2" "-g"...

node-gyp rebuild fails when installing webpack and other packages on OSX

node.js,osx,npm,node-gyp
I'm on OS 10.10.13, with node v0.12.4 and npm v2.10.1. Whenever I run the following command to install webpack npm install webpack --save-dev --save-exact, I get the following error when node-gyp rebuild is called: > [email protected] install /Volumes/Macintosh HD/Users/ev_blurbs/Sites/products/react-week/new-app/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents > node-gyp rebuild SOLINK_MODULE(target) Release/.node SOLINK_MODULE(target) Release/.node: Finished CXX(target)...

Node js Express doesn't recognize npm inside projectfolder

node.js,express,dependencies,npm
I'm trying to install express through cmd in windows. My problem is installing dependencies after i've successfully installed express and built a skeleton of the framework. It requires to install dependencies. It even tells me the code line cd Myprojectname && npm install But it says npm is not recognized...

Sailsjs with angularjs npm install error

angularjs,gruntjs,npm,sails.js
i am using sails js backend and frontend angularjs. i have given npm install. npm install package show this error: npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer [email protected] wants [email protected]~0.4.0 npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.4.0 npm ERR! peerinvalid...

Microsoft Azure - Gulp 3.8.10 does not work on fresh Web App instance

azure,npm,gulp,kudu
I am using a fresh instance of a Web App with Node 12.3 and NPM 2.9.1. Gulp PATH appears to be set to D:\Program Files (x86)\gulp\3.8.10. I believe Gulp 3.8.10 has a bug that should be fixed with an update to 3.8.11. I am unable to use gulp until this...

Excluding files for BrowserSync not working

node.js,npm,gulp,browser-sync
I'm currently following John Papa's course on JavaScript Build Automation with GulpJS. At the moment I try to setup browser-sync with gulp-nodemon to keep my browser in sync. This is my gulp task to serve my development build: gulp.task('serve-dev', ['inject'], function () { var isDev = true; var nodeOptions =...

Error installing cordova

cordova,npm,browserify,visual-studio-cordova,jsonstream
After running this command: sudo npm install -g cordova I get this error: npm ERR! notarget No compatible version found: [email protected]'>=1.0.3-0 <2.0.0-0' npm ERR! notarget Valid install targets: npm ERR! notarget ["0.0.0","0.1.0","0.1.1","0.1.2","0.1.3","0.2.0","0.2.1","0.2.2","0.2.3","0.3.0","0.3.1","0.3.2","0.3.3","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4","0.5.0","0.6.0","0.6.1","0.6.2","0.6.3","0.6.4","0.7.0","0.7.1","0.8.0","0.7.2","0.7.3","0.7.4","0.8.1","0.8.2","0.8.3","0.8.4","0.9.0","0.10.0"] npm ERR! notarget npm ERR!...

Yeoman angular grunt-serve vs http-serve

angularjs,gruntjs,npm,yeoman,http-server
I've just used Yeoman to create an Angular project that looks great when I run grunt serve. But then I decided to view it by running http-server, and the page gets displayed without the formatting and without the images. Does anyone know why that is and if I'll run into...

Meteor, NPM Modules, and Fiber Callback

javascript,node.js,mongodb,meteor,npm
I am using request and cheerio to parse a website and get specific content out of that, technically a quote. here's my code ( server.js ) : q = new Mongo.Collection('quotelist'); postList = new Mongo.Collection('quotes'); fruits = []; var a = ""; var cheerio = Meteor.npmRequire('cheerio'); var request = Meteor.npmRequire('request');...

Node js can't require modules installed globally in OS X

node.js,osx,npm
I installed module by sudo npm install -g xxx in OS X, and the command echoes the module was installed in /usr/local/lib/node_modules/xxx. But the require('xxx') still fails claiming `Cannot find module 'xxx'. Only installing the module locally again by sudo npm install xxx can fix the error. Anything need to...

Is updating npm after installing node recommended?

node.js,npm
After installing node via nvm I normally also update npm to the newest version. It this actually a recommended practice? Or should I use the npm version which is installed with node?

How to let Webpack require a root node_module instead of an child package?

backbone.js,npm,webpack
I have installed backbone and backbone.babysitter trough npm. When I use backbone in my scripts like this: import Backbone from "backbone"; It loads the installed backbone version 1.2.1. This works fine until I want to use backbone.babysitter. When backbone.babysitter loads it needs to add properties to backbone itself. But the...

NPM : how to just run post-install?

node.js,npm,package.json
Just a simple question : in my node.js project, how could I just run the postinstall script, without running install before ? FYI, this is my package.json : { "name": "gestionclientjs", ..., "dependencies": { ... }, "repository": {}, "devDependencies": { ... }, "engines": { "node": ">=0.10.0" }, "scripts": { "test":...

Install package.json dependencies globally

json,node.js,npm,gulp
There is the following 'package.json' file with dependencies: { "name": "xxx_web_app", "version": "1.0.0", "description": "", "main": "gulpfile.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "some.git" }, "author": "", "license": "ISC", "dependencies": { "bower": "^1.4.1", "connect-history-api-fallback": "^1.1.0", "gulp": "^3.8.11", "gulp-clean": "^0.3.1",...

Programmatically find the 'main' javascript file for libraries on GitHub

javascript,github,deployment,npm
I'm looking to find a way of finding the "key" javascript file from javascript libraries posted on GitHub in as automated as a way as possible. So for example, this bootstrap extension called Jasny has a ton of files on the GitHub page. To get the key js file you...

Proper npm install --save behavior?

npm
All documentation I have seen indicates that using --save argument with npm install should update the dependencies in package.json. This does not work for me. Packages install successfully without any error in the npm console output, but `package.json' remains unchanged. What am I missing? I have seen nothing in my...

Cannot find a submodule imported inside a module installed from npm

node.js,npm,reactjs,browserify,html-datalist
I would like to use a node.js module from https://github.com/asbjornenge/react-datalist using browserify. I did install the module locally at my working directory. In that directory, I created a javascript file, main.jsx var React = require('react'); var ReactDatalist = require('react-datalist'); var options = ['apple','orange','pear','pineapple','melon']; React.render(<ReactDatalist list="fruit" options={options} />, document.body); Then, I...

npm update doesn't update the package

npm,package
I've run into a issue where I try to update a package on a remote server, specifically the mongoose package. If I run npm mongoose --version it will return a version number of 1.3.10. However in package.json the version specified is ^2.7.4. I've tried to run npm update and it...

Can anyone explain what es7 reflect-metadata is all about?

npm,ecmascript-6,jspm,systemjs,es7
Been studying ES6, JSPM & angular2 for a week now and I found this repo ES6-loader if we look at the index.html at the bottom script you'll see System.import('reflect-metadata') .then(function() { return System.import('app/index'); }) .catch(console.log.bind(console)); This is using JSPM's systemjs polyfill to get ES6's import. Question: What is the reflect-metadata...

React from NPM cannot be used on the client because 'development' is not defined. The bundle was generated from Webpack

javascript,node.js,npm,reactjs,webpack
I'm creating a React Node.js app and I'm trying to generate a Webpack bundle containing the React source code I loaded from NPM. However, it seems that the React code from NPM cannot be used directly in the client. It triggers this error: Uncaught ReferenceError: development is not defined The...

npm installs packages and dependencies in the project root directory

node.js,npm
I switched from Windows to Mac. When I'm trying to install npm modules, the packages and their dependencies are created inside the project root directory. On Windows the module was installing into ./node_modules, with all dependencies inside module folder. Is there something I need to configure to make it work...

why `node_modules` idea exists?

npm
What was the reasoning behind node_modules folder? Why not just use $CWD/mymodule instead of $CWD/node_modules/mymodule. To me it seems just like unnecessary annoying sophistication, but what is the actual reason? And a side question, can I tell npm forget about node_modules and just use '.' instead (the git way)?...

How to create web client application with nodejs and npm like angularjs tutorial

javascript,angularjs,node.js,npm
I am new to nodejs, npm also angularjs. I have read and tried the angularjs tutorial project hosted on https://github.com/angular/angular-phonecat.git, which for me is really exciting because it shows how easy to maintain the modules with bower, testing with jasmine and karma and perform e2e with protractor using npm command,...

error installing zmq (ZeroMQ)

node.js,npm,message-queue,zeromq,pyzmq
I am trying to install node module zmq I have referred to this https://github.com/JustinTulloss/zeromq.node/wiki/Installation#installation-on-windows However i get this error while installing the module 0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files (x86)\\nodejs\\\\node.exe', 1 verbose cli 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'install', 1...

Npm package upgrade notification availlable?

node.js,npm,packages,software-distribution
I wrote a node package which contains breaking changes in the next release. Does there exist a way to notify developers about that via console while upgrading via npm?

return a js object from a javascript function that is called from a node cpp addon

node.js,npm,return-value
I am tyring to create and return a javascript function object from a function that is called from a c++ node addon. The object was getting created, but wasn't getting returned by the function. callback function that creates an object named cursor var callback_fn = function(record){ var res = new...

Why doesn't postinstall run everytime?

jenkins,gruntjs,npm
I have a package.json file that has the following JSON at the bottom. "scripts": { "postinstall": [ "./node_modules/bower/bin/bower install && ./node_modules/protractor/bin/webdriver-manager update" ] } My reason for having this is so bower dependencies and my protractor tests will run after an "npm install". However, it seems that "postinstall" doesn't always...

npm install error not installing BrowserSync package

node.js,cmd,npm,command-prompt,browser-sync
Trying to install BrowserSync I've followed the steps to install the package through the command line, installed node.js and then I went on to install npm through the command line. Now when I try to install browser-sync with the following line npm install -g browser-sync you will see it is...

Hot to set the title of a Windows console while npm is running?

node.js,windows,batch-file,npm
I have started to develop a web application project on my Windows machine, for which I use npm, bower and the nodejs HTTP server. For easier start of the HTTP server, I created the batch file: @echo off title HTTP Server npm start npm start starts the http-server. For that...

npm bin property is not working as expected

node.js,npm,command-line-interface
I wrote a simple 'addheader' node module and published it on npm. It contains a cli script which I registered in the package.json config-file in the bin property as follows: { "name" : "addheader", "bin" : "./addHeaderCli.js" } Installing the module with "npm install addheader" I can see the cli...

Include libraries with Composer, NPM or Bower

php,npm,composer-php,gulp,bower
I have been getting into Composer, NPM and Bower recently. I no there's a lot of overlap between their capabilities and I was wondering if my approach is sane? If not, what should I do? I typically start my PHP projects by setting up composer to load my PHP libraries...