Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node_modules is not recognized as an internal or external command

I'm trying to write a test automation script using appium, jasmine, and perfecto mobile. I'm using the project cloned from the following URL with my own configuration Appium Javascript Example

The problem is when I execute the npm test command I get the following error

node_modules is not recognized as an internal or external command

This is how the packages.json script looks like:

  {
  "name": "perfecto_appium_sample",
  "version": "1.0.0",
  "description": "The following sample shows how to Install an application and use WebDriverIO to automate and test it.<br/> It uses selendroid test application which can be downloaded from [here](https://github.com/PerfectoCode/AppsForSamples/tree/master/selendroid-test-app-0.17.0).",
  "main": "perfectoSpec.js",
  "scripts": {
    "test": "node_modules/webdriverio/bin/wdio wdio.conf.js",
    "start": "wdio wdio.conf.js"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "wdio": "^0.3.3",
    "wdio-jasmine-framework": "^0.2.19",
    "wdio-mocha-framework": "^0.5.12"
  },
  "dependencies": {
    "wd": "^1.5.0",
    "webdriverio": "^4.10.2"
  },
  "keywords": []
}
like image 327
Noel Omondi Avatar asked Dec 05 '22 12:12

Noel Omondi


2 Answers

you need to provide relative path properly:

"scripts": {
    "test": "node ./node_modules/webdriverio/bin/wdio wdio.conf.js",
    "start": "wdio wdio.conf.js"
  }
like image 191
kgangadhar Avatar answered Dec 08 '22 01:12

kgangadhar


Just remove the paths "node_modules/webdriverio/bin/" and simply specify "wdio wdio.conf.js". It should work.

like image 26
Dasarathan Sampath Avatar answered Dec 08 '22 02:12

Dasarathan Sampath