Monday, 25 September 2017

Error: The specified module could not be found.module.js:434 return process.dlopen(module, path._makeLong(filename)); ^

Error: %1 is not a valid Win32 application.
\\?\C:\Users\\Documents\latest code\node_modules\java\bu
ild\Release\nodejavabridge_bindings.node
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\\Documents\latest codePI\node_modules\java\lib\nodeJavaBridge.js:21:16)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\\Documents\latest code\
PI\node_modules\java\index.js:2:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)

Wednesday, 30 August 2017

Tuesday, 29 August 2017

npm install -g npm ERR! Error: EPERM: operation not permitted, open

C:\Users\Srinivas>npm install -g bower
npm WARN deprecated bower@1.8.0: ..psst! While Bower is maintained, we recommend Yarn and Webpack for *new* front-end projects! Yarn's advantage is security and reliability, and Webpack's is support for both CommonJS and AMD projects. Currently there
's no migration path, but please help to create it: https://github.com/bower/bower/issues/2467
npm ERR! tar.unpack untar error C:\Users\Srinivas\AppData\Roaming\npm-cache\bower\1.8.0\package.tgz
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! path C:\Users\Srinivas\AppData\Roaming\npm\node_modules\bower\lib\config.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall open

npm ERR! Error: EPERM: operation not permitted, open 'C:\Users\Srinivas\AppData\Roaming\npm\node_modules\bower\lib\config.js'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM: operation not permitted, open 'C:\Users\Srinivas\AppData\Roaming\npm\node_modules\bower\lib\config.js']
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'open',
npm ERR!   path: 'C:\\Users\\Srinivas\\AppData\\Roaming\\npm\\node_modules\\bower\\lib\\config.js' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Srinivas\npm-debug.log



Solution :
clean npm cache 

C:\Users\Srinivas>npm cache clean

Then try

C:\Users\Srinivas>npm install -g bower
npm WARN deprecated bower@1.8.0: ..psst! While Bower is maintained, we recommend Yarn and Webpack for *new* front-end projects! Yarn's advantage is security and reliability, and We
's no migration path, but please help to create it: https://github.com/bower/bower/issues/2467
C:\Users\Srinivas\AppData\Roaming\npm\bower -> C:\Users\Srinivas\AppData\Roaming\npm\node_modules\bower\bin\bower
bower@1.8.0 C:\Users\Srinivas\AppData\Roaming\npm\node_modules\bower

Monday, 28 August 2017

Friday, 25 August 2017

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/srinivasnidadavolu/Downloads/testapp/app.js:42:20)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)

    at node.js:974:3



solution:
Declare strict mode at the beginning of the function or constant to use Block-scoped declarations.

"use strict"



Tuesday, 13 June 2017

npm install angular-cli -g issue

> node-sass@4.5.3 install C:\Users\\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\node-sass                                        > node scripts/install.js                                                                                                                                                                                                                                                                                       Cached binary found at C:\Users\\AppData\Roaming\npm-cache\node-sass\4.5.3\win32-x64-46_binding.node                                                                                                                                                                                                    > node-sass@4.5.3 postinstall C:\Users\\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\node-sass                                    > node scripts/build.js                                                                                                                                                                                                                                                                                         Binary found at C:\Users\\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\node-sass\vendor\win32-x64-46\binding.node                 Testing binary                                                                                                                                          Binary is fine                                                                                                                                          npm ERR! Windows_NT 6.1.7601                                                                                                                            npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"       npm ERR! node v4.5.0                                                                                                                                    npm ERR! npm  v2.15.9                                                                                                                                   npm ERR! code ETARGET                                                                                                                                                                                                                                                                                           npm ERR! notarget No compatible version found: balanced-match@'>=1.0.0 <2.0.0'                                                                          npm ERR! notarget Valid install targets:                                                                                                                npm ERR! notarget ["0.0.0","0.0.1","0.1.0","0.2.0","0.2.1","0.3.0","0.4.0","0.4.1","0.4.2"]                                                             npm ERR! notarget                                                                                                                                       npm ERR! notarget This is most likely not a problem with npm itself.                                                                                    npm ERR! notarget In most cases you or one of your dependencies are requesting                                                                          npm ERR! notarget a package version that doesn't exist.                                                                                                 npm ERR! notarget                                                                                                                                       npm ERR! notarget It was specified as a dependency of 'brace-expansion'                                                                                 npm ERR! notarget                                                                                                                                                                                                                                                                                               npm ERR! Please include the following file with any support request:                                                                                    npm ERR!master\angular-src\npm-debug.log                                                                                                                                                                                                                                 

Wednesday, 12 October 2016

Saturday, 8 October 2016

Friday, 7 October 2016

geospacial - location nearby

{
    "code" : {
        "_bsontype" : "Int32",
        "value" : 2
    },
    "errmsg" : "$geometry is required for geo near query",
    "message" : "$geometry is required for geo near query",
    "name" : "MongoError",
    "ok" : {
        "_bsontype" : "Double",
        "value" : 0
    },
    "stack" : "MongoError: $geometry is required for geo near quer" +
              "at Function.MongoError.create (C:\\Users\\Administrator\\AppData\\Local\\mongobooster\\app-3.0.5\\resources\\app.asar\\node_modules\\mongodb-core\\lib\\error.js:31:11" +
              "at queryCallback (C:\\Users\\Administrator\\AppData\\Local\\mongobooster\\app-3.0.5\\resources\\app.asar\\node_modules\\mongodb-core\\lib\\cursor.js:213:36" +
              "at C:\\Users\\Administrator\\AppData\\Local\\mongobooster\\app-3.0.5\\resources\\app.asar\\node_modules\\mongodb-core\\lib\\connection\\pool.js:436:1" +
              "at _combinedTickCallback (internal/process/next_tick.js:67:7" +
              "at process._tickCallback (internal/process/next_tick.js:98:9)",
    "waitedMS" : {
        "_bsontype" : "Long",
        "high_" : 0,
        "low_" : 0
    }
}

Thursday, 6 October 2016

Wednesday, 5 October 2016

Monday, 3 October 2016

Issue in Running Mongodb in windows

PS C:\mongodb\Server\3.2\bin> mongod
16:09.996+0000 I CONTROL  [initandlisten] MongoDB starting : pid=3244 port=27017 dbpath=C:\data\db\ 64-bit
 host=WIN-GV01B0P34FK I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2 I CONTROL  [initandlisten] db version v3.2.9-rc0-6-g032eea3
2016-10-03T13:16:09.997+0000 I CONTROL  [initandlisten] git version: 032eea30f14b37f7c39a5cb989e49978e556f6a3
2016-10-03T13:16:09.997+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1p-fips 9 Jul 2015
2016-10-03T13:16:09.998+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2016-10-03T13:16:09.998+0000 I CONTROL  [initandlisten] modules: none
2016-10-03T13:16:09.998+0000 I CONTROL  [initandlisten] build environment:
2016-10-03T13:16:09.998+0000 I CONTROL  [initandlisten]     distmod: 2008plus-ssl
2016-10-03T13:16:09.998+0000 I CONTROL  [initandlisten]     distarch: x86_64
2016-10-03T13:16:09.998+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2016-10-03T13:16:09.998+0000 I CONTROL  [initandlisten] options: {}
2016-10-03T13:16:09.999+0000 I STORAGE  [initandlisten] exception in initAndListen: 29 Data directory C:\data\db\ not fo
und., terminating
2016-10-03T13:16:09.999+0000 I CONTROL  [initandlisten] dbexit:  rc: 100


Solution:


Provide the data path

"C:\MongoDB\Server\3.2\bin\mongod.exe" --dbpath "d:\test\mongo\data"

 

Tuesday, 4 February 2014

MongoDB Installation for MS-Windows


This page explains the installation procedure of MongoDB for MS-Windows environment.

MongoDB Installation
This will setup MongoDB as a service on windows, so that the database will start automatically following each reboot cycle.


  1. Go to http://www.mongodb.org/downloads and choose the appropriate package (Windows 32-bit versus 64-bit; choose *2008+ if you are on Windows-7 64-bit)
  2. Extract the zip-file, and rename the folder to "mongodb"
  3. Move the resulting folder to C:\work resulting in C:\work\mongodb (all files should be in the bin-directory inside mongodb-dir)
  4. Create a directory for storing the generated logs at C:\work\mongodb\log
  5. MongoDB needs a data directory for storage; create a directory C:\work\data\db
  6. Create a config-file at C:\work\mongodb\mongod.cfg directory with the following content
    logpath=C:\work\mongodb\log\mongo.log
    dbpath=C:\work\data
  7. Start the Command Prompt by selecting the Start Menu, then All Programs, then Accessories, then right click Command Prompt, and select Run as Administrator from the popup menu.
  8. In the command-prompt with admin-privileges, type the following commands:
    C:\work\mongodb\bin\mongod.exe --config C:\work\mongodb\mongod.cfg --install
    net start MongoDB
    Description: https://teambox.com/send/cf1fb338f759313f

  9. Exit the cmd-prompt shell. This should install MongoDB as service which will  start automatically following each reboot cycle
  10. Open an ordinary cmd-prompt shell by typing "cmd.exe" in Windows start, and type "C:\work\mongodb\bin\mongo.exe" ; you should see a MongoDB-Shell which is connected to the "test" database.
  11. Type "db.test.save( { a: 1 } )" to add a record to the data-base
  12. Now check if the record was added by typing "db.test.find()"
    Description: https://teambox.com/send/d196efe7d45efd54


Monday, 3 June 2013

Debugging node.js

ndb  -  Command line debugger.

Eclipse debugger plugin for V8.

Node inspector is a graphical debugging tool for node.js.


To install node inspector module



$ npm install node-inspector -g


To enable debug mode


$ node --debug  your/node/program.js

To pause script on first line

$ node --debug -brk your/short/node/script.js 

To use profiles panel, install v8-profiler module:

$ npm install v8-profiler


start node in debug mode

$ node --debug app.js

node inspector optionally supports the v8 profiler.
it collects cpu and heap snapshots.

--trace-gc  option to watch gc behavior.





Wednesday, 27 March 2013

Tuesday, 26 March 2013

Format of NPM Package

NPM package is a directory structure with package.json file. 
Package.json file basic flow as follows

{ name: "nameOfPackage", version:"1.1", main: :mainModuleName", Node Modules[46] modules: { "mod1" : "lib/mod1", "mod2" : "lib/mod2" }

To search a package, use the following command,

$ npm search nameOfPackage


Help command as follows

$ npm help <command> 

Find NPM Package:

$npm install moduleName



Saturday, 19 January 2013

JavaScript Introduction

       JavaScript is a light weight ,interpreted programming language. It is the most popular scripting language which is used by many popular browsers like Mozilla, Safari,Opera,Chrome etc.
      JavaScript is embedded directly into Html Pages.

Features of JavaScript:

Embed into HTML:
 JavaScript can be easily embedded into HTML pages.

Events :
It will react to events like clicking button,finish loading page etc.

Read/Write HTML elements:
It is used to read/write HTML element.

Validation:
It is used to validate form data beform submitting to the server.


Thursday, 17 January 2013

what is node

-->
        

                Node is a pltatform built on V8 which is already used by Google crome.It was created by Ryan Dahl.In order to execute javascript,
             Node is a platform for writing serverside javascript for writing scalable internet applications where as Javascript is for writing client side script.It was created by Ryan Dahl.
Every function in node is Asynchronous,nonblocking i/o.
Node applications uses asynchronous event driven model.

Node consists of lots of modules and no need to write from scratch. Node is a combination of tho things, run time environment and a library.

  

 

 



Thursday, 10 January 2013

Non Blocking I/O in Node.js

-->




Difference between Blocking and non blocking

Blocking:
In blocking, we can read file one after the other in a time interval.



Non Blocking:
In non blocking, we can read files at same time.