node_modules is not recognized as an internal or external command

Noe*_*ndi 2 javascript automated-tests node.js appium

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

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": []
}
Run Code Online (Sandbox Code Playgroud)

kga*_*har 8

you need to provide relative path properly:

"scripts": {
    "test": "node ./node_modules/webdriverio/bin/wdio wdio.conf.js",
    "start": "wdio wdio.conf.js"
  }
Run Code Online (Sandbox Code Playgroud)

  • 这是在 Windows 上,当我添加点时,错误变为“。” 不被识别为内部或外部命令 (2认同)
  • “`node ./node_modules/webdriverio/bin/wdio wdio.conf.js`”怎么样? (2认同)