watson-developer-cloud / assistant-simple

A simple sample application demonstrating the Watson Assistant api.
https://assistant-simple.ng.bluemix.net/
Apache License 2.0
482 stars 1.14k forks source link

Error: spawn node-gyp ENOENT #66

Closed hborg004 closed 7 years ago

hborg004 commented 7 years ago

I have followed instructions but i keep getting this error:

on compile Error: spawn node-gyp ENOENT
 at exports._errnoException (util.js:1026:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ] }
[execSync v1.0.2]
    Native code compile failed!!

and when i try to run  i get this error

 conversation-simple@0.1.1 start C:\conversation-simple-master
> node server.js

C:\conversation-simple-master\node_modules\watson-developer-cloud\lib\base_service.js:78
        throw new Error('Argument error: username and password are required unless use_unauthenticated is set');
        ^

Error: Argument error: username and password are required unless use_unauthenticated is set
    at ConversationV1.BaseService.initCredentials (C:\conversation-simple-master\node_modules\watson-developer-cloud\lib\base_service.js:78:15)
    at ConversationV1.BaseService (C:\conversation-simple-master\node_modules\watson-developer-cloud\lib\base_service.js:45:18)
    at new ConversationV1 (C:\conversation-simple-master\node_modules\watson-developer-cloud\conversation\v1.js:30:15)
    at Object.<anonymous> (C:\conversation-simple-master\app.js:48:20)
    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 (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! conversation-simple@0.1.1 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the conversation-simple@0.1.1 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 conversation-simple 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 conversation-simple
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls conversation-simple
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\conversation-simple-master\npm-debug.log

I am not sure why this is happening. What should i name my env file as? maybe that is the problem?

germanattanasio commented 7 years ago

You are missing the credentials for conversation.

In a .env file:

CONVERSATION_USERNAME
CONVERSATION_PASSWORD
hborg004 commented 7 years ago

@germanattanasio i have an .env file but im not sure i have it configured correctly. how should it be named?

my env file has this

# Environment variables
WORKSPACE_ID=XXX
CONVERSATION_USERNAME=XXX
CONVERSATION_PASSWORD=XXXX
#Optional params, delete any which are not used!
#Optional params to enable Speech to text
STT_USERNAME=
STT_PASSWORD=
#Optional cloudant URL for loggin
CLOUDANT_URL=
#If cloudant url is specified a user name and password must be specified to secure the logging endpoints
LOG_USER=
LOG_PASS=

but i dont think i named it correctly

germanattanasio commented 7 years ago

call it .env and make sure is in the root folder

hborg004 commented 7 years ago

@germanattanasio thank you, it worked. i had to run it on linux because for some reason windows did not allow me to name it .env

kwiatks commented 7 years ago

What was the name of the .env file you used ? does it have to be a particular name matching anything else ? I get the "Error: Argument error: username and password are required unless use_unauthentic ated is set" error even with a .env file (called car.env). I am running in Windows 7.

germanattanasio commented 7 years ago

You need a .env file in the root of your project. On Sat, Feb 18, 2017 at 1:10 AM kwiatks notifications@github.com wrote:

What was the name of the .env file you used ? does it have to be a particular name matching anything else ? I get the "Error: Argument error: username and password are required unless use_unauthentic ated is set" error even with a .env file (called car.env)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/watson-developer-cloud/conversation-simple/issues/66#issuecomment-280827682, or mute the thread https://github.com/notifications/unsubscribe-auth/AATHRUGSJ2v5UHbr7kNuZLfiRF2kNVh0ks5rdplagaJpZM4KzYGz .

hborg004 commented 7 years ago

the name was just .env nothing else

On Sat, Feb 18, 2017 at 2:10 AM, kwiatks notifications@github.com wrote:

What was the name of the .env file you used ? does it have to be a particular name matching anything else ? I get the "Error: Argument error: username and password are required unless use_unauthentic ated is set" error even with a .env file (called car.env)

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/watson-developer-cloud/conversation-simple/issues/66#issuecomment-280827682, or mute the thread https://github.com/notifications/unsubscribe-auth/ARAtKs7Z6Uk__hZa9FEICm_-P7fCOefCks5rdplbgaJpZM4KzYGz .

mitchmason commented 7 years ago

And it HAS to be just .env or else it won't work