[running appium server by programming] Error: uncaughtException: Cannot find module 'lodash.repeat'

i try to run appium server by programming ,
here is my problem :

C:\Users\eroch>C:\Appium\node.exe C:\Appium\node_modules\appium\bin\appium.js
error: uncaughtException: Cannot find module 'lodash.repeat' date=Thu Feb 11 201
6 11:23:13 GMT+0100 (Paris, Madrid), pid=7860, uid=null, gid=null, cwd=C:\Appium
\node_modules\appium, execPath=C:\Appium\node.exe, version=v0.12.9, argv=[C:\App
ium\node.exe, C:\Appium\node_modules\appium\bin\appium.js], rss=70504448, heapTo
tal=57638656, heapUsed=41029972, loadavg=[0, 0, 0], uptime=1022.5759733, trace=[
column=15, file=module.js, function=Function.Module._resolveFilename, line=336,
method=Module._resolveFilename, native=false, column=25, file=module.js, functio
n=Function.Module._load, line=278, method=Module._load, native=false, column=17,
 file=module.js, function=Module.require, line=365, method=require, native=false
, column=17, file=module.js, function=require, line=384, method=null, native=fal
se, column=14, file=C:\Appium\node_modules\appium\node_modules\appium-chromedriv
er\node_modules\appium-jsonwp-proxy\node_modules\appium-logger\node_modules\npml
og\node_modules\gauge\node_modules\lodash.padright\node_modules\lodash._createpa
dding\index.js, function=, line=9, method=null, native=false, column=26, file=mo
dule.js, function=Module._compile, line=460, method=_compile, native=false, colu
mn=10, file=module.js, function=Object.Module._extensions..js, line=478, method=
Module._extensions..js, native=false, column=32, file=module.js, function=Module
.load, line=355, method=load, native=false, column=12, file=module.js, function=
Function.Module._load, line=310, method=Module._load, native=false, column=17, f
ile=module.js, function=Module.require, line=365, method=require, native=false,
column=17, file=module.js, function=require, line=384, method=null, native=false
, column=21, file=C:\Appium\node_modules\appium\node_modules\appium-chromedriver
\node_modules\appium-jsonwp-proxy\node_modules\appium-logger\node_modules\npmlog
\node_modules\gauge\node_modules\lodash.padright\index.js, function=, line=10, m
ethod=null, native=false, column=26, file=module.js, function=Module._compile, l
ine=460, method=_compile, native=false, column=10, file=module.js, function=Obje
ct.Module._extensions..js, line=478, method=Module._extensions..js, native=false
, column=32, file=module.js, function=Module.load, line=355, method=load, native
=false, column=12, file=module.js, function=Function.Module._load, line=310, met
hod=Module._load, native=false, column=17, file=module.js, function=Module.requi
re, line=365, method=require, native=false, column=17, file=module.js, function=
require, line=384, method=null, native=false, column=11, file=C:\Appium\node_mod
ules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\no
de_modules\appium-logger\node_modules\npmlog\node_modules\gauge\progress-bar.js,
 function=, line=6, method=null, native=false, column=26, file=module.js, functi
on=Module._compile, line=460, method=_compile, native=false, column=10, file=mod
ule.js, function=Object.Module._extensions..js, line=478, method=Module._extensi
ons..js, native=false, column=32, file=module.js, function=Module.load, line=355
, method=load, native=false, column=12, file=module.js, function=Function.Module
._load, line=310, method=Module._load, native=false, column=17, file=module.js,
function=Module.require, line=365, method=require, native=false, column=17, file
=module.js, function=require, line=384, method=null, native=false, column=13, fi
le=C:\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\a
ppium-jsonwp-proxy\node_modules\appium-logger\node_modules\npmlog\log.js, functi
on=, line=3, method=null, native=false, column=26, file=module.js, function=Modu
le._compile, line=460, method=_compile, native=false, column=10, file=module.js,
 function=Object.Module._extensions..js, line=478, method=Module._extensions..js
, native=false, column=32, file=module.js, function=Module.load, line=355, metho
d=load, native=false, column=12, file=module.js, function=Function.Module._load,
 line=310, method=Module._load, native=false, column=17, file=module.js, functio
n=Module.require, line=365, method=require, native=false, column=17, file=module
.js, function=require, line=384, method=null, native=false, column=15, file=C:\A
ppium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-j
sonwp-proxy\node_modules\appium-logger\build\lib\logger.js, function=, line=13,
method=null, native=false, column=26, file=module.js, function=Module._compile,
line=460, method=_compile, native=false], stack=[Error: Cannot find module 'loda
sh.repeat',     at Function.Module._resolveFilename (module.js:336:15),     at F
unction.Module._load (module.js:278:25),     at Module.require (module.js:365:17
),     at require (module.js:384:17),     at Object.<anonymous> (C:\Appium\node_
modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy
\node_modules\appium-logger\node_modules\npmlog\node_modules\gauge\node_modules\
lodash.padright\node_modules\lodash._createpadding\index.js:9:14),     at Module
._compile (module.js:460:26),     at Object.Module._extensions..js (module.js:47
8:10),     at Module.load (module.js:355:32),     at Function.Module._load (modu
le.js:310:12),     at Module.require (module.js:365:17),     at require (module.
js:384:17),     at Object.<anonymous> (C:\Appium\node_modules\appium\node_module
s\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\appium-logge
r\node_modules\npmlog\node_modules\gauge\node_modules\lodash.padright\index.js:1
0:21),     at Module._compile (module.js:460:26),     at Object.Module._extensio
ns..js (module.js:478:10),     at Module.load (module.js:355:32),     at Functio
n.Module._load (module.js:310:12),     at Module.require (module.js:365:17),
 at require (module.js:384:17),     at Object.<anonymous> (C:\Appium\node_module
s\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_
modules\appium-logger\node_modules\npmlog\node_modules\gauge\progress-bar.js:6:1
1),     at Module._compile (module.js:460:26),     at Object.Module._extensions.
.js (module.js:478:10),     at Module.load (module.js:355:32),     at Function.M
odule._load (module.js:310:12),     at Module.require (module.js:365:17),     at
 require (module.js:384:17),     at Object.<anonymous> (C:\Appium\node_modules\a
ppium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_mod
ules\appium-logger\node_modules\npmlog\log.js:3:13),     at Module._compile (mod
ule.js:460:26),     at Object.Module._extensions..js (module.js:478:10),     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 Object.<anonymous> (C:\Appium\node_modules\appium\node_modules\appium-chrom
edriver\node_modules\appium-jsonwp-proxy\node_modules\appium-logger\build\lib\lo
gger.js:13:15),     at Module._compile (module.js:460:26)]

please answer if you have any suggestion or question to help me to resolve :slightly_smiling:

I did a google search on the above and here is the first entry, which looks like it will solve the problem:

1 Like

1st of all thx to help me .
2 nd : i tried but the console answered me like there is a big probleme with llot’s of fail error and warning

C:\Appium\node_modules\appium\bin>npm install lodash --save

> [email protected] install C:\Appium\node_modules\appium\node_modules\msgpack
> node-gyp rebuild


C:\Appium\node_modules\appium\node_modules\msgpack>if not defined npm_config_nod
e_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\no
de_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Appium\node_modules\appium\node_modules\msgpack
gyp ERR! node -v v5.6.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install C:\Appium\node_modules\appium\node_modules\bufferutil

> node-gyp rebuild


C:\Appium\node_modules\appium\node_modules\bufferutil>if not defined npm_config_
node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..
\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Appium\node_modules\appium\node_modules\bufferutil
gyp ERR! node -v v5.6.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install C:\Appium\node_modules\appium\node_modules\utf-8-
validate
> node-gyp rebuild


C:\Appium\node_modules\appium\node_modules\utf-8-validate>if not defined npm_con
fig_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\.
.\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Appium\node_modules\appium\node_modules\utf-8-validate
gyp ERR! node -v v5.6.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp re
build`
npm WARN install:[email protected] Exit status 1

> [email protected] install C:\Appium\node_modules\appium\node_modules\ws\node_mo
dules\bufferutil
> node-gyp rebuild


C:\Appium\node_modules\appium\node_modules\ws\node_modules\bufferutil>if not def
ined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\nod
e-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node ""
 rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Appium\node_modules\appium\node_modules\ws\node_modules\bufferut
il
gyp ERR! node -v v5.6.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] Exit status 1

> [email protected] install C:\Appium\node_modules\appium\node_modules\ws\nod
e_modules\utf-8-validate
> node-gyp rebuild


C:\Appium\node_modules\appium\node_modules\ws\node_modules\utf-8-validate>if not
 defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin
\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (nod
e "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Appium\node_modules\appium\node_modules\ws\node_modules\utf-8-va
lidate
gyp ERR! node -v v5.6.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:[email protected] [email protected] install: `node-gyp re
build`
npm WARN install:[email protected] Exit status 1
npm WARN saveError Problems were encountered
npm WARN saveError Please correct and try again.
npm WARN saveError invalid: have [email protected] (expected: ~0.0.6) C:\Appiu
m\node_modules\appium\node_modules\bplist-parser
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_m
odules\assert
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium
\node_modules\bdd-with-opts
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_mod
ules\chai
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\app
ium\node_modules\chai-as-promised
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\
node_modules\gps-demo-app
npm WARN saveError extraneous: [email protected] C:\Appium\node_module
s\appium\node_modules\grunt-contrib-jshint
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\no
de_modules\grunt-exec
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\ap
pium\node_modules\grunt-mocha-test
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\n
ode_modules\grunt-newer
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_mod
ules\gulp
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\nod
e_modules\gulp-jscs
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\
node_modules\gulp-jshint
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_
modules\js-yaml
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appiu
m\node_modules\jshint-stylish
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\
node_modules\merge-stream
npm WARN saveError extraneous: [email protected] C:\Appium\node_modul
es\appium\node_modules\mocha-jenkins-reporter
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\n
ode_modules\node-static
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\n
ode_modules\promisepipe
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_m
odules\rewire
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\
node_modules\run-sequence
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\n
ode_modules\sample-apps
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_m
odules\sinon
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\no
de_modules\sinon-chai
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\app
ium\node_modules\socket.io-client
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_mo
dules\socks
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules
\appium\node_modules\spawn-mocha-parallel
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_
modules\uncolor
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appi
um\node_modules\underscore-cli
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_mo
dules\unorm
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_modul
es\wd
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\nod
e_modules\wd-bridge
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_m
odules\yargs
npm WARN saveError extraneous: [email protected] C:\Appium\node_modules\appium\node_mo
dules\yiewd
- [email protected] node_modules\appium-chromedriver\node_modules\appium-jsonwp-pro
xy\node_modules\source-map-support\node_modules\source-map\node_modules\amdefine

- [email protected] node_modules\appium-chromedriver\node_modules\appium-jsonwp-
proxy\node_modules\source-map-support\node_modules\source-map
- [email protected] node_modules\appium-chromedriver\node_modules\request\node_mod
ules\har-validator\node_modules\bluebird
- [email protected] node_modules\appium-chromedriver\node_modules\teen_process\nod
e_modules\bluebird
- [email protected] node_modules\node-simctl\node_modules\teen_process\node_module
s\bluebird
[email protected] C:\Appium\node_modules\appium
+-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | |   `-- [email protected]
| | |     +-- [email protected]
| | |     | `-- [email protected]
| | |     |   `-- [email protected]
| | |     |     `-- [email protected]
| | |     `-- [email protected]
| | |       `-- [email protected]
| | |         `-- [email protected]
| | `-- [email protected]
| |   `-- [email protected]
| |     `-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| |   `-- [email protected]
| |     `-- [email protected]
| |       `-- [email protected]
| |         `-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| |   `-- [email protected]
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
|       `-- [email protected]
+-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | |   `-- [email protected]
| | |     `-- [email protected]
| | |       `-- [email protected]
| | `-- [email protected]
| |   `-- [email protected]
| |     `-- [email protected]
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
+-- [email protected]
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
+-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| |   `-- [email protected]
| |     `-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| |   `-- [email protected]
| |     `-- [email protected]
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
`-- [email protected]
  `-- [email protected]
    `-- [email protected]
      `-- [email protected]

npm WARN optional Skipping failed optional dependency /sample-apps/ios-webview-a
pp:
npm WARN notsup Not compatible with your operating system or architecture: ios-w
[email protected]
npm WARN optional Skipping failed optional dependency /sample-apps/ios-uicatalog
:
npm WARN notsup Not compatible with your operating system or architecture: ios-u
[email protected]
npm WARN optional Skipping failed optional dependency /sample-apps/ios-test-app:

npm WARN notsup Not compatible with your operating system or architecture: ios-t
[email protected]
npm WARN [email protected] No license field.

3rd node appium seem to work but i don’t know if i can reaaly use it with all of the optimal possibilities so i’ll certainly ask few more question later.

I’ve seen this kind of error reported here before. I’m not much of a Windows guy but it seems that node has a bunch of dependencies that don’t get installed by default. It’s asking for you to install Python, but I have a feeling that there are more dependencies waiting for to throw errors once you do this.

Can I ask you to share the instructions you are following to get this up & running? I’d like to take a look & see if I can find better instructions for you.

i fixed all my problems :smiley: i was following this tuto that is pretty simple and interresting :slightly_smiling:


my mistake was to not set up the appPackage and the appActivity , i thought it was able to run without these 2 args because i did it before. but in that case it’s necessary.

Now it’s running pretty well but sometimes the appium don’t close very well and if i use the function stop before running test , it’s crash all the time.