okta / samples-nodejs-express-4

Express 4 samples. Will publish an artifact that can be consumed by end-to-end sample repos
Other
120 stars 121 forks source link

Move dotenv from devDependencies to dependencies in package.json #115

Closed derektiffany closed 3 years ago

derektiffany commented 3 years ago

Description

Moves dotenv from dependencies to devDepencies in package.json. dotenv is a runtime dependency, and this change will fix issues if NODE_ENV=production or other causes under which dependencies are installed but not devDependencies.

Prior behavior

Resulted in:

> @okta/samples-nodejs-express-4@3.1.0 okta-hosted-login-server
> node okta-hosted-login/server.js

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

Error: Cannot find module 'dotenv'
Require stack:
- /(...)/samples-nodejs-express-4/config.js
- /(...)/samples-nodejs-express-4/okta-hosted-login/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/derek.tiffany/Documents/GitHub/samples-nodejs-express-4/config.js:2:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/(...)/samples-nodejs-express-4/config.js',
    '/(...)/samples-nodejs-express-4/okta-hosted-login/server.js'
  ]
}

New behavior

The above now results in:

> @okta/samples-nodejs-express-4@3.1.0 okta-hosted-login-server
> node okta-hosted-login/server.js

(...)
App started on port 8080

Resolves

114

oleksandrpravosudko-okta commented 3 years ago

Merged in https://github.com/okta/samples-nodejs-express-4/pull/115 (https://github.com/okta/samples-nodejs-express-4/commit/64afdc6dc2e1d3f1595ab22ee7c1e08e133e97a9)