Closed ghost closed 7 years ago
The entire file name should be .env
.
Windows tends to make this difficult; you can try putting the name in quotes when you save it, or renaming it from the command line. I think this is the command to rename it, although I don't have a windows machine handy to test on right now:
move process.env .env
Also, I edited your post to remove the API key. You should really delete it and create a new one, though. Once a key has been compromised, there's not really any way to "un-compromise" it.
When I run npm start, I get the following in the gitbash : $ npm start
c:\BlueMix\visual-recognition-nodejs\node_modules\watson-developer-cloud\visual-recognition\v3.js:154 throw new Error('Argument error: api_key was not specified'); ^
Error: Argument error: api_key was not specified at VisualRecognitionV3.initCredentials (c:\BlueMix\visual-recognition-nodejs\node_modules\watson-developer-cloud\visual-recognition\v3.js:154:13) at VisualRecognitionV3.BaseService (c:\BlueMix\visual-recognition-nodejs\node_modules\watson-developer-cloud\lib\base_service.js:45:18) at new VisualRecognitionV3 (c:\BlueMix\visual-recognition-nodejs\node_modules\watson-developer-cloud\visual-recognition\v3.js:122:15) at Object. (c:\BlueMix\visual-recognition-nodejs\app.js:39:25)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
npm ERR! Windows_NT 10.0.14393 npm ERR! argv "c:\Program Files\nodejs\node.exe" "c:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" npm ERR! node v6.9.4 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! VisualRecognition@3.0.0 start:
node server.js
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the VisualRecognition@3.0.0 start script 'node server.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the VisualRecognition package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node server.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs VisualRecognition npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls VisualRecognition npm ERR! There is likely additional logging output above.npm ERR! Please include the following file with any support request: npm ERR! c:\BlueMix\visual-recognition-nodejs\npm-debug.log
I think perhaps I did step 7 wrong, which was not very clear. What should the .env file be called? I named it "process.env" and the following are its contents:
Environment variables
VISUAL_RECOGNITION_API_KEY=[snip]