keen / keen-analysis.js

A light JavaScript client for Keen
https://keen.io/docs/compute/
MIT License
40 stars 15 forks source link

`npm run start` fails #73

Closed woahdae closed 4 years ago

woahdae commented 4 years ago

Contributing guidelines say to run npm run start, but I get the following. It looks to me like a step is missing, like downloading a "demo-config" project?

[git/master-]:keen-analysis.js% npm run start

> keen-analysis@3.5.0 start /Users/woody/Src/keen-analysis.js
> NODE_ENV=development webpack-dev-server

internal/modules/cjs/loader.js:626
    throw err;
    ^

Error: Cannot find module '../demo-config'
Require stack:
- /Users/woody/Src/keen-analysis.js/webpack.config.js
- /Users/woody/Src/keen-analysis.js/node_modules/webpack-cli/bin/convert-argv.js
- /Users/woody/Src/keen-analysis.js/node_modules/webpack-dev-server/bin/webpack-dev-server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
    at Function.Module._load (internal/modules/cjs/loader.js:527:27)
    at Module.require (internal/modules/cjs/loader.js:681:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/Users/woody/Src/keen-analysis.js/webpack.config.js:14:22)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:681:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/woody/Src/keen-analysis.js/webpack.config.js',
    '/Users/woody/Src/keen-analysis.js/node_modules/webpack-cli/bin/convert-argv.js',
    '/Users/woody/Src/keen-analysis.js/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keen-analysis@3.5.0 start: `NODE_ENV=development webpack-dev-server`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the keen-analysis@3.5.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/woody/.npm/_logs/2020-05-13T00_40_14_982Z-debug.log
maciejrybaniec commented 4 years ago

Hi @woahdae Thank You for reporting this issue.

All of JavaScript SDKs in development mode require a globaldemo-config.js file with projectId and access keys. However this is a pretty legacy pattern used across Keen SDK's and the documentation is not fully clear about how to run a project.

I created a ticket in our Backlog to address this issue by:

  1. Get rid of demo-config.js file.
  2. Update documentation about "how to run the project".
maciejrybaniec commented 4 years ago

Documentation updated. The global config file moved as local repository file.