Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SED not installed windows machine #1

Open
Tommertom opened this issue Nov 26, 2019 · 3 comments
Open

SED not installed windows machine #1

Tommertom opened this issue Nov 26, 2019 · 3 comments
Labels
good first issue Good for newcomers

Comments

@Tommertom
Copy link
Contributor

Tommertom commented Nov 26, 2019

HI,
your package.json relies on SED to be installed on the local machine, which is not default the case on win10 machines

"postinstall": "sed -i \"\" -E 's/node: false/node:{stream:true,crypto:true}/' node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js"

Removing the lines in package.json allows to run npm i, but not ionic serve.

Replacing line 91 in browser.js as per sed script (node:false to node:{stream:true,crypto:true} also does not give joy running ionic serve

`

npm.cmd run ionic:serve -- --host=localhost --port=8100
[npm] > [email protected] ionic:serve C:\Gebruikers\Developer\Src\ula-holder-workshop\app
[npm] > ng run app:serve --extra-webpack-config webpack.config.js "--host=localhost" "--port=8100"
[INFO] Waiting for connectivity with npm...
[npm] Unknown option: '--extra-webpack-config'
[npm] Unknown option: 'webpack.config.js'
[npm] npm ERR! code ELIFECYCLE
[npm] npm ERR! errno 1
[npm] npm ERR! [email protected] ionic:serve: ng run app:serve --extra-webpack-config webpack.config.js "--host=localhost" "--port=8100"
[npm] npm ERR! Exit status 1
[npm] npm ERR!
[npm] npm ERR! Failed at the [email protected] ionic:serve script.
[npm] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[npm] npm ERR! A complete log of this run can be found in:
[npm] npm ERR! C:\Users\GruintjesTEJ\AppData\Roaming\npm-cache_logs\2019-11-26T12_19_36_453Z-debug.log

[ERROR] npm has unexpectedly closed (exit code 1).

    The Ionic CLI will exit. Please check any output above for error details.

`

@rabomarnix rabomarnix added the good first issue Good for newcomers label Nov 26, 2019
@rabomarnix
Copy link
Owner

rabomarnix commented Nov 26, 2019

Hi Tom,

Thanks for this issue raised. Wasn't able to properly test this on a windows machine. Can you try removing the --extra-webpack-config flag here in package.json locally?
I recently learned that this flag is probably not necessary after replacing the values in browser.js

@Tommertom
Copy link
Contributor Author

Tommertom commented Nov 26, 2019

That does not work fully. There is still an error in the postinstall line as it needs sed which is not present by default on windows machines. See original message.

I assume removing the flag also involves removing the webpack.config.js argument? Which I did, but obviously won't help on the postinstall. If I fixed that myself and then ran npm run ionic:serve I actually get an error on this config flag (unknown option ....).

So I am unsure about the two package.json scripts you have there : ionic:serve and postinstall.

In fact, when I place the src folder of the repo in a fresh newly baked ionic angular project (and add QR scanner), all works fine. That package.json in the fresh ionic project does not have those lines.

And looking at your code, I also don't see a need for them. So I guess you can remove them from the repo? Why were they added in the first place? crypto support? Where are the crypto lines in the code? - ain't much going on in the code, lots of todos in the comments :)

@rabomarnix
Copy link
Owner

crypto and stream must be enabled since the ULA plugins will use those components. The problem is that angular's webpack configuration disables those. We applied this workaround but maybe there is a more constructive solution to this problem.. Need to figure that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants