Tag: npm

How to setup node-schedule for every day at 12am

I am using node-schedule to schedule my tasks. Now I need to schedule a job everyday at 12am. Below given is the code I am using, var rule3 = schedule.scheduleJob(’00 00 00 * * *’, function(){ console.log(‘my test job!’); }); This is not working for me. Any help appreciated. Thanks in advance.

nodejs applicaiton giving error “%1 is not a valid Win32 application” in windows machine

My Nodejs application works fine in ubuntu. When i tried to deploy the same in Windows machine it showed below error. =>node server.js D:\home\site\wwwroot D:\home\site\wwwroot\node_modules\ffi\node_modules\bindings\bindings.js:83 throw e ^ Error: %1 is not a valid Win32 application. D:\home\site\wwwroot\node_modules\ffi\node_modules\ref\build\Release\binding.node at Error (native) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at bindings I […]

Node.js & npm: How can I create custom npm cli commands?

Say for example that I quite often use npm list -g -depth 0 as command, and I’d like to alias it with npm listC or npm list -c1. How do I do that?

Sendbird SDK not working with React Native

I am following sendbird‘s tutorial on building a chat app with react-native, and i get the following error when I try to import sendbird sdk: Unable to resolve module http from …/SendbirdSample/node_modules/sendbird/SendBird.min.js: Unable to find this module in its module map or any of the node_modules/http and its parent directories I deleted node_modules folder and […]

Passing variables from NPM Scripts to Webpack

I have a production build with Webpack that uses node’s process.env to set environment variables: webpack.prod.babel.js: const DefinePlugin = new webpack.DefinePlugin({ ‘process.env’: { NODE_ENV: JSON.stringify(‘production’), API_URL: JSON.stringify(‘https://myprodurl.com’), }, }); packge.json: “scripts: { “build:prod”: “webpack” } It’s working fine, but I need something different. I need to set the production url as variable in the NPM […]

What is the difference between linking stylesheets and requiring them in Webpack + VueJs?

Using the VueJs and Webpack combo I have figured out that to include external stylesheets (for example bootstrap) you can do one of two things: In your main js script you could require the stylesheet like this: require(‘./assets/lib/bootstrap.min.css’); Or you could simply move it to a static folder accessed via Express and link it in […]

Error installing NPM for node.js

I’m trying to install npm on ubuntu 11.04 using the “git all the way” method found in this gist I keep getting this error after running sudo make install on npm $ sudo make install ! [ -d .git ] || git submodule update –init –recursive node cli.js install -g -f bash: node: command not […]

How to set tarball url of node-gyp via environment variable

I want to use custom node tarball to build node modules via node-gyp, is there any way to set it via environment variable or some config files for node-gyp or npm?

Node.js – NPM pacakge publish locally and install the locally published NPM package for a Node.js application

I have created a local NPM pacakge, i am trying to install the local package using fallowing command “npm install ../replacevalue/replacevalue-0.1.1tgz”. This is giveing me fallowing error. My agenda is to “Locally test my npm modules without publishing them to npmjs.org”. 0 info it worked if it ends with ok 1 verbose cli [ ‘D:\\Program […]

heroku — npm postinstall script to run grunt task depending on enviro

I’ve got two heroku node.js apps, one for prod and one for dev, and I also have a Gruntfile with dev- and prod-specific tasks. I know you can set up package.json to run grunt as a postinstall hook for npm, but can you specify somehow different tasks to be run depending on what enviro you’re […]

Node.js is the Best Javascript runtime in the world.