okta / samples-nodejs-express-4

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

Does not start on Windows #18

Closed abhijeetkpawar closed 6 years ago

abhijeetkpawar commented 7 years ago

npm start gives following error:

$ npm start

> @okta/samples-nodejs-express-4@1.0.0 prestart D:\GitRepo\github\samples-nodejs-express-4
> build-frontend

'DIST_OUT' is not recognized as an internal or external command,
operable program or batch file.
child_process.js:526
    throw err;
    ^

Error: Command failed: DIST_OUT=D:\GitRepo\github\samples-nodejs-express-4\dist npm run build
    at checkExecSyncError (child_process.js:483:13)
    at execSync (child_process.js:523:13)
    at Object.<anonymous> (D:\GitRepo\github\samples-nodejs-express-4\node_modules\@okta\samples-js-angular-1\scripts\build-frontend.js:23:1)
    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.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
nbarbettini commented 7 years ago

The problem is actually here: https://github.com/okta/samples-js-angular-1/blob/master/scripts/build-frontend.js#L23

I'm not yet sure how to fix this so it works under Windows.

haishengwu-okta commented 7 years ago

It's actually trying to set up an env variable. In windows, it works like set Foo=bar;. Give an shot to see if fix in your local?

An general fix might be executing OS oriented scripts.

synthmusic commented 6 years ago

If you made it here and just want the quick fix, click the Windows build fix # 19 above to see what to change in your \node_modules\@okta\samples-js-angular-1\scripts\build-frontend.js

there is some discussion about how to fix more properly, but until pull request accepted or fixed another way, since you're just running a sample project.... Thanks @abhijeetkpawar !

nbarbettini commented 6 years ago

The downstream fix for build-frontend.js has been merged. Also, this repo will be significantly overhauled in #31 and we're testing to make sure Windows works just fine. 😄

Closing this as the issue should be fixed now, but if anyone runs into more build problems, please open new issues. Thanks for your patience y'all!