Follow Me:

Sunday 2 July 2017

ReactJS Webpack Module build failed: Error: Cannot find module

Running the npm start in reactjs by using nodejs, its throwing error like "Module build failed: Error: Cannot find module".


Module build failed: Error: Cannot find module 'locate-path'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (F:\php\htdocs\reactjs\node_modules\pkg-dir\node_modul
es\find-up\index.js:3:20)
    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)
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-serve
r ./main.js
webpack: Failed to compile.

Solution:

Actually when running the script that time corresponding module is not available. For this excute below commands, that is issue will be resolved.

1. To find the webpack errors 
Run your webpack with display-error-details option to enable more debugging on the errors.

webpack --progress --color --watch --display-error-details


2. Run below Commands in your command promt

npm list -g

npm install --global  [Your Missing Module Name]

npm install --global locate-path

npm install wisp --save
npm install --global --verbose promised-io

3. Set your Environment variable

For Windows:

set NODE_PATH=C:\Users\codingslover\AppData\Roaming\npm\node_modules

4. Check Module Folder

Sometimes our installed available in our user appdata folders also. So that goto
C:\Users\codingslover\AppData\Roaming\npm\node_modules
folder, find the missing modules and copy the module and place into your execution folder.

Example : 

I am executing my reactjs npm module in
F:php/htdocs/reacttest/
, inside module folder need to check module availability.





Sunday 11 June 2017

How to check the latest patch version applied to magento?

Magento latest patch version need to check will use below commands. It will show entire list of patch in your project.

Runned the command in your putty.

grep -F '|' app/etc/applied.patches.list|cut -f 2,1 -d'|'

Another options

Goto App/etc folder and find the file name as "applied.patches.list".

Monday 6 February 2017

Npm node js can't find package.json

The most important things in your package.json are the name and version fields. Those are actually required, and your package won't install without them. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version.

npm --version
npm install express
npm init -y



More reference:

https://docs.npmjs.com/files/package.json

Friday 28 October 2016

PHP sessions default timeout


We are settind the Session Time out in Php as mentioned as below:

session.gc_maxlifetime = 1440
(1440 seconds = 24 minutes)