googleapis / nodejs-vision

This repository is deprecated. All of its content and history has been moved to googleapis/google-cloud-node.
https://cloud.google.com/vision/
Apache License 2.0
495 stars 139 forks source link

Cannot find module \'redis\' #256

Closed TLKG closed 5 years ago

TLKG commented 5 years ago

VSC, ran this in powershell:

npm run samples-test

got

C:\nodejs-vision-master\samples\system-test\textDetection.test.js:25
   24: test.cb(`should detect texts`, t => {
   25:   const redis = require('redis');
   26:   const client = redis.createClient();

  Error thrown in test:

  Error {
    code: 'MODULE_NOT_FOUND',
    message: 'Cannot find module \'redis\'',
  }
TLKG commented 5 years ago

Still the same after another npm install

JustinBeckwith commented 5 years ago

Greetings! Can you try the following?

$ rm -rf node_modules package-lock.json samples/node_modules samples/package-lock.json
$ npm install
$ cd samples
$ npm install
$ cd ../
$ npm run samples-test

If all that doesn't work, please share the output of:

$ node -v

Thanks!

TLKG commented 5 years ago

I'm using nvm and MS' VSC, node version is v10.8.0. anyway, here is the result of first command:

rm -rf node_modules package-lock.json samples/node_modules samples/package-lock.json
Remove-Item : A parameter cannot be found that matches parameter name 'rf'.
At line:1 char:4
+ rm -rf node_modules package-lock.json samples/node_modules samples/pa ...
+    ~~~
    + CategoryInfo          : InvalidArgument: (:) [Remove-Item], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
JustinBeckwith commented 5 years ago

Sorry, I'm struggling to figure out how to delete directories in PowerShell myself 😆 @jskeet or @amanda-tarafa can one of y'all translate rm -rf node_modules package-lock.json samples/node_modules samples/package-lock.json into PowerShell ?

TLKG commented 5 years ago

Justin, what version of node is expected?

JustinBeckwith commented 5 years ago

Just making sure you're using Node.js 8 or up :)

jskeet commented 5 years ago

The simplest way of getting those rm commands to work is probably to run bash, which may well have been installed with Git. But failing that,

rmdir /s /q node_modules
del package-lock.json
rmdir /s /q samples/node_modules
del samples/package-lock.json

Or just delete them with Explorer of course...

JustinBeckwith commented 5 years ago

Greetings @TLKG! Were you able to work through the problem? Still need help?