Node.js v6.11.2, npm v3.10.10, selenium-webdriver 3.5.0, on Windows 7
Every time I try to npm install <--save> selenium-webdriver
, I get the following warning:
F:\Program Files\nodejs>npm install --save selenium-webdriver
npm WARN saveError ENOENT: no such file or directory, open 'F:\Program Files\nodejs\package.json'
F:\Program Files\nodejs
`-- selenium-webdriver@3.5.0
npm WARN enoent ENOENT: no such file or directory, open 'F:\Program Files\nodejs\package.json'
npm WARN nodejs No description
npm WARN nodejs No repository field.
npm WARN nodejs No README data
npm WARN nodejs No license field.
It's right, there is no F:\Program Files\nodejs\package.json
file. Multiple re-installs of node.js (I tried a couple of versions), and there is NEVER a package.json at that location.
Still, an npm list
makes it look like selenium-webdriver is there:
...
| +-- validate-npm-package-name@2.2.2
| | `-- builtins@0.0.7
| +-- which@1.2.11
| | `-- isexe@1.1.2
| +-- wrappy@1.0.2
| `-- write-file-atomic@1.2.0
`-- **selenium-webdriver@3.5.0**
+-- jszip@3.1.4
...
Still, whenever I try to run a test that requires selenium-webdriver (with a command like: 'node myfile.js'), module.js:471 throws the error in the title "Error: Cannot find module 'selenium-webdriver'". Grrrrr.
I'm new to this stuff (pretty obvious, eh?), but I have spent more than a day looking around the web, and have found no relevant information. There are similar questions here, but not quite the same. Anybody know how to fix this? (Please?)