Why can't i see my home page in Heroku (with Nodejs)? - node.js

This is my project: https://github.com/dade1987/StockPricePrediction
I deployed it in Heroku but i can't see my homepage on this link: https://price-predictor-eu.herokuapp.com/
I see it locally.
Heroku says:
2020-06-27T10:33:17.545687+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=price-predictor-eu.herokuapp.com request_id=be6efc89-ba70-4ba8-bb4e-26b85ccce869 fwd="151.36.107.145" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
I tried to do it too:
webpack-dev-server route
✖ 「wdm」: Hash: 6575b1f5bc373f461724
Version: webpack 4.28.4
Time: 5599ms
Built at: 06/27/2020 2:53:13 PM
1 asset
Entrypoint main = bundle.js
[0] (webpack)-dev-server/client/clients/SockJSClient.js 4.06 KiB {0} [built]
[2] (webpack)-dev-server/client/utils/log.js 964 bytes {0} [built]
[3] multi (webpack)-dev-server/client?http://0.0.0.0:8080 route 40 bytes {0} [built]
[4] (webpack)-dev-server/client?http://0.0.0.0:8080 4.29 KiB {0} [built]
[5] ./node_modules/strip-ansi/index.js 161 bytes {0} [built]
[6] ./node_modules/ansi-regex/index.js 135 bytes {0} [built]
[7] (webpack)-dev-server/client/socket.js 1.53 KiB {0} [built]
[10] (webpack)-dev-server/client/overlay.js 3.51 KiB {0} [built]
[11] ./node_modules/ansi-html/index.js 4.16 KiB {0} [built]
[12] ./node_modules/html-entities/lib/index.js 449 bytes {0} [built]
[16] ./node_modules/loglevel/lib/loglevel.js 8.41 KiB {0} [built]
[17] (webpack)-dev-server/client/utils/sendMessage.js 402 bytes {0} [built]
[18] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {0} [built]
[21] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {0} [built]
[30] (webpack)/hot sync nonrecursive ^\.\/log$ 170 bytes {0} [built]
+ 17 hidden modules
ERROR in Entry module not found: Error: Can't resolve 'route' in '/app'
ERROR in multi (webpack)-dev-server/client?http://0.0.0.0:8080 route
Module not found: Error: Can't resolve 'route' in '/app'
# multi (webpack)-dev-server/client?http://0.0.0.0:8080 route main[1]
Where is my error? I am not very expert in node.
Thank you

Related

issue with an older nodejs code import { resolve }

I have an older version of code written in 2017 using React.
Getting this error while running npm run start. Not to sure if it is node version related.
Using node v: 10.16.2
$ npm run start
> starter-kit-react#0.0.1 start C:\xampp\htdocs\react\tool-master
> webpack-dev-server --host 0.0.0.0 --port 8080
C:\xampp\htdocs\react\tool-master\webpack.config.babel.js:4
import { resolve } from 'path';
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:723:23)
at loader (C:\xampp\htdocs\react\tool-master\node_modules\babel-register\lib\node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (C:\xampp\htdocs\react\tool-master\node_modules\babel-register\lib\node.js:154:7)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at requireConfig (C:\xampp\htdocs\react\tool-master\node_modules\webpack\bin\convert-argv.js:96:18)
at C:\xampp\htdocs\react\tool-master\node_modules\webpack\bin\convert-argv.js:109:17
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! starter-kit-react#0.0.1 start: `webpack-dev-server --host 0.0.0.0 --port 8080`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the starter-kit-react#0.0.1 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! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2019-08-08T00_15_37_258Z-debug.log
I was able to go past this step after upgrading babel
Babel Upgrade details here
However, now I am stuck where code is showing the below error. Initially it showed the processing went well and then stuck at some syntax error. Not sure what it is.
render(
<Provider store={store}>
<ContentProvider lang="en">
<App />
</ContentProvider>
</Provider>,
document.getElementById('app')
);
Error shown below:
$ yarn start
yarn run v1.17.3
$ webpack-dev-server --host 0.0.0.0 --port 8080
Project is running at http://0.0.0.0:8080/
webpack output is served from /
Hash: b06107c62fb824ae192d
Version: webpack 2.7.0
Time: 498ms
Asset Size Chunks Chunk Names
vendor.e33c4b5498769f380132.js 326 kB 0 [emitted] [big] vendor
app.955a9ae9e538a29c3be3.js 2.58 kB 1 [emitted] app
manifest.58eaa606281aa83df76a.js 6.07 kB 2 [emitted] manifest
vendor.e33c4b5498769f380132.js.map 387 kB 0 [emitted] vendor
app.955a9ae9e538a29c3be3.js.map 104 bytes 1 [emitted] app
manifest.58eaa606281aa83df76a.js.map 6.17 kB 2 [emitted] manifest
index.html 126 bytes [emitted]
chunk {0} vendor.e33c4b5498769f380132.js, vendor.e33c4b5498769f380132.js.map (vendor) 323 kB {2} [initial] [rendered]
[3] (webpack)-dev-server/client?http://0.0.0.0:8080 7.93 kB {0} [built]
[4] ./~/ansi-html/index.js 4.26 kB {0} [built]
[5] ./~/ansi-regex/index.js 135 bytes {0} [built]
[6] ./~/html-entities/index.js 231 bytes {0} [built]
[9] ./~/loglevel/lib/loglevel.js 7.86 kB {0} [built]
[10] ./~/node-libs-browser/~/events/events.js 13.6 kB {0} [built]
[11] ./~/node-libs-browser/~/punycode/punycode.js 14.7 kB {0} [built]
[15] ./~/sockjs-client/dist/sockjs.js 181 kB {0} [built]
[16] ./~/strip-ansi/index.js 161 bytes {0} [built]
[17] ./~/url/url.js 23.3 kB {0} [built]
[18] ./~/url/util.js 314 bytes {0} [built]
[19] (webpack)-dev-server/client/overlay.js 3.67 kB {0} [built]
[20] (webpack)-dev-server/client/socket.js 1.08 kB {0} [built]
[22] (webpack)/hot nonrecursive ^\.\/log$ 160 bytes {0} [built]
[23] (webpack)/hot/emitter.js 77 bytes {0} [built]
+ 8 hidden modules
chunk {1} app.955a9ae9e538a29c3be3.js, app.955a9ae9e538a29c3be3.js.map (app) 2.34 kB {0} [initial] [rendered]
[2] ./src/index.jsx 2.3 kB {1} [built] [failed] [1 error]
[24] multi (webpack)-dev-server/client?http://0.0.0.0:8080 ./src/index 40 bytes {1} [built]
chunk {2} manifest.58eaa606281aa83df76a.js, manifest.58eaa606281aa83df76a.js.map (manifest) 0 bytes [entry] [rendered]
ERROR in ./src/index.jsx
Module build failed: SyntaxError: C:\xampp\htdocs\react\tool-master\src\index.jsx: Unexpected token (18:2)
16 |
17 | render(
> 18 | <Provider store={store}>
| ^
19 | <ContentProvider lang="en">
20 | <App />
21 | </ContentProvider>
at Parser.raise (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:6325:17)
at Parser.unexpected (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:7642:16)
at Parser.parseExprAtom (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8841:20)
at Parser.parseExprSubscripts (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8412:23)
at Parser.parseMaybeUnary (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8392:21)
at Parser.parseExprOps (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8267:23)
at Parser.parseMaybeConditional (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8240:23)
at Parser.parseMaybeAssign (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8187:21)
at Parser.parseExprListItem (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:9491:18)
at Parser.parseCallExpressionArguments (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8621:22)
at Parser.parseSubscript (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8514:29)
at Parser.parseSubscripts (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8433:19)
at Parser.parseExprSubscripts (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8422:17)
at Parser.parseMaybeUnary (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8392:21)
at Parser.parseExprOps (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8267:23)
at Parser.parseMaybeConditional (C:\xampp\htdocs\react\tool-master\node_modules\#babel\parser\lib\index.js:8240:23)
# multi (webpack)-dev-server/client?http://0.0.0.0:8080 ./src/index
Child html-webpack-plugin for "index.html":
chunk {0} index.html 542 kB [entry] [rendered]
[0] ./~/lodash/lodash.js 541 kB {0} [built]
[1] ./~/html-webpack-plugin/lib/loader.js!./~/html-webpack-plugin/default_index.ejs 538 bytes {0} [built]
[2] (webpack)/buildin/global.js 509 bytes {0} [built]
[3] (webpack)/buildin/module.js 517 bytes {0} [built]
webpack: Failed to compile.

oom invoked even though enough memory available

I use Android P-OS. and kernel version is msm-4.14
oom invoked and killing process since booting up. However, memory is abundant.
My memory size is 8GByte, Swap is 1GByte.
I'm not even using a swap.
[ 59.901334] Killing 'ndroid.keychain' (2011), adj 906,\x0a to free 87268kB on behalf of 'Binder:883_2' (938)\x0a Free CMA is 246200kB\x0a Total reserve is 242332kB\x0a Total free pages is 5100764kB\x0a Total file cache is 978224kB
[ 59.903948] Killing 'Jit thread pool' (2016), adj 906,\x0a to free 88676kB on behalf of 'ActivityManager' (960)\x0a Free CMA is 246200kB\x0a Total reserve is 242332kB\x0a Total free pages is 5100764kB\x0a Total file cache is 978224kB
[ 60.007328] oom_reaper: reaped process 2011 (ndroid.keychain), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
$ free
total used free shared buffers
Mem: 7842377728 3144630272 4697747456 2084864 14852096
-/+ buffers/cache: 3129778176 4712599552
Swap: 1073737728 0 1073737728
$ meminfo
MemTotal: 7658572 kB
MemFree: 4589120 kB
MemAvailable: 5800580 kB
Buffers: 14416 kB
Cached: 1415944 kB
SwapCached: 0 kB
Active: 630232 kB
Inactive: 1299508 kB
Active(anon): 501820 kB
Inactive(anon): 1876 kB
Active(file): 128412 kB
Inactive(file): 1297632 kB
Unevictable: 2888 kB
Mlocked: 2888 kB
SwapTotal: 1048572 kB
SwapFree: 1048572 kB
Dirty: 92 kB
Writeback: 0 kB
AnonPages: 502148 kB
Mapped: 745728 kB
Shmem: 2036 kB
Slab: 520776 kB
SReclaimable: 130688 kB
SUnreclaim: 390088 kB
KernelStack: 28336 kB
PageTables: 40972 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 4877856 kB
Committed_AS: 95986336 kB
VmallocTotal: 263061440 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
CmaTotal: 303104 kB
CmaFree: 246200 kB
I don't understand this situation.
Why does this happen? Is there a way to avoid it?
Answer Myself
It is not Out Of Memory.
Just oom_reaper is working by sigkill signal.
Memory is enough
Thanks

Pact-js - Provider/Consumer test missing files in the repository

Hi everyone, I am trying to implement PACT JS. Currently I am referring to this implementation :
npm install (or yarn install) and the consumer side command (mocha app/client/spec/PostServiceClient.spec.js) worked well.The pact file was generated.
But the provider side command (node app/service/spec/PostService.spec.js) failed.It's seemed due to the localhost server. But i didn't succeed in running the server. It missed 'THREE' module.
After adding 'THREE' module, i couldn't compile the build. So 2 files are missing in the repository main.js and Template.html (--> webpack.config.js).
And i didn't succeed in posting a comment in Lucas M Blog (http://hecodes.com/2016/10/better-testing-microservices-using-consumer-driven-contracts-node-js/)
Could someone help me?
Wilson Mahann
Thanks a lot for your help
Error messages trying to run the server
$ yarn server
yarn run v1.9.4
$ webpack-dev-server --host 0.0.0.0 --config webpack.config.js --devtool eval --progress --hot --inline
module.js:550
throw err;
^
Error: Cannot find module 'three'
at Function.Module._resolveFilename (module.js:548:15)
at Function.resolve (internal/module.js:18:19)
at Object. (D:\Workspace\pact-js\js00\pact-node-example-master\webpack.config.js:34:31)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at module.exports (D:\Workspace\pact-js\js00\pact-node-example-master\node_modules\webpack\bin\convert-argv.js:80:13)
at Object. (D:\Workspace\pact-js\js00\pact-node-example-master\node_modules\webpack-dev-server\bin\webpack-dev-server.js:68:48)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
So I had successfully the missing module "three" : yarn add three
And run the server
$ yarn server
yarn run v1.9.4
$ webpack-dev-server --host 0.0.0.0 --config webpack.config.js --devtool eval --progress --hot --inline
clean-webpack-plugin: D:\Workspace\pact-js\js00\pact-node-example-master\dist has been removed. 70% 1/1 build modules
http://0.0.0.0:8080/
webpack result is served from /
content is served from ./app 30% 1/3 build modulescontent is served from ./app 44% 4/7 build modulescontent is served from ./app 61% 6/7 build modulescontent is served from ./app 54% 12/16 build modulescontent is served from ./app 62% 15/17 build modulescontent is served from ./app 45% 16/27 build modulescontent is served from ./app 35% 19/44 build modulescontent is served from ./app 49% 29/44 build modulescontent is served from ./app 65% 42/45 build modulescontent is served from ./app 48% 44/69 build modulescontent is served from ./app 52% 49/69 build modulescontent is served from ./app 62% 60/69 build modulescontent is served from ./app 66% 67/71 build modulescontent is served from ./app 69% 75/76 build modulescontent is served from ./app Hash: 2948e04a9d9577c7951d
Version: webpack 1.15.0
Time: 569ms
Asset Size Chunks Chunk Names
bundle.2948e04a9d9577c7951d.js 285 kB 0 [emitted] app
index.html 2.27 kB [emitted]
chunk {0} bundle.2948e04a9d9577c7951d.js (app) 227 kB [rendered]
[0] multi app 52 bytes {0} [built] [1 error]
[1] (webpack)-dev-server/client?http://0.0.0.0:8080 4.16 kB {0} [built]
[2] ./~/url/url.js 23.3 kB {0} [built]
[3] ./~/url/~/punycode/punycode.js 14.6 kB {0} [built]
[4] (webpack)/buildin/module.js 251 bytes {0} [built]
[5] ./~/url/util.js 314 bytes {0} [built]
[6] ./~/querystring/index.js 127 bytes {0} [built]
[7] ./~/querystring/decode.js 2.4 kB {0} [built]
[8] ./~/querystring/encode.js 2.09 kB {0} [built]
[9] ./~/strip-ansi/index.js 161 bytes {0} [built]
[10] ./~/ansi-regex/index.js 135 bytes {0} [built]
[11] (webpack)-dev-server/client/socket.js 897 bytes {0} [built]
[12] ./~/sockjs-client/lib/entry.js 244 bytes {0} [built]
[13] ./~/sockjs-client/lib/transport-list.js 613 bytes {0} [built]
[14] ./~/sockjs-client/lib/transport/websocket.js 2.72 kB {0} [built]
[15] ./~/process/browser.js 5.42 kB {0} [built]
[16] ./~/sockjs-client/lib/utils/event.js 2 kB {0} [built]
[17] ./~/sockjs-client/lib/utils/random.js 746 bytes {0} [built]
[18] ./~/sockjs-client/lib/utils/browser-crypto.js 438 bytes {0} [built]
[19] ./~/sockjs-client/lib/utils/url.js 975 bytes {0} [built]
[20] ./~/url-parse/index.js 12 kB {0} [built]
[21] ./~/requires-port/index.js 753 bytes {0} [built]
[22] ./~/querystringify/index.js 1.58 kB {0} [built]
[23] ./~/debug/src/browser.js 4.73 kB {0} [built]
[24] ./~/debug/src/debug.js 4.39 kB {0} [built]
[25] ./~/ms/index.js 2.76 kB {0} [built]
[26] ./~/inherits/inherits_browser.js 672 bytes {0} [built]
[27] ./~/sockjs-client/lib/event/emitter.js 1.27 kB {0} [built]
[28] ./~/sockjs-client/lib/event/eventtarget.js 1.85 kB {0} [built]
[29] ./~/sockjs-client/lib/transport/browser/websocket.js 210 bytes {0} [built]
[30] ./~/sockjs-client/lib/transport/xhr-streaming.js 1.25 kB {0} [built]
[31] ./~/sockjs-client/lib/transport/lib/ajax-based.js 1.31 kB {0} [built]
[32] ./~/sockjs-client/lib/transport/lib/sender-receiver.js 1.18 kB {0} [built]
[33] ./~/sockjs-client/lib/transport/lib/buffered-sender.js 2.3 kB {0} [built]
[34] ./~/sockjs-client/lib/transport/lib/polling.js 1.32 kB {0} [built]
[35] ./~/sockjs-client/lib/transport/receiver/xhr.js 1.58 kB {0} [built]
[36] ./~/sockjs-client/lib/transport/sender/xhr-cors.js 343 bytes {0} [built]
[37] ./~/sockjs-client/lib/transport/browser/abstract-xhr.js 4.8 kB {0} [built]
[38] ./~/sockjs-client/lib/transport/sender/xhr-local.js 352 bytes {0} [built]
[39] ./~/sockjs-client/lib/utils/browser.js 560 bytes {0} [built]
[40] ./~/sockjs-client/lib/transport/xdr-streaming.js 984 bytes {0} [built]
[41] ./~/sockjs-client/lib/transport/sender/xdr.js 2.46 kB {0} [built]
[42] ./~/sockjs-client/lib/transport/eventsource.js 766 bytes {0} [built]
[43] ./~/sockjs-client/lib/transport/receiver/eventsource.js 1.58 kB {0} [built]
[44] ./~/sockjs-client/lib/transport/browser/eventsource.js 37 bytes {0} [built]
[45] ./~/sockjs-client/lib/transport/lib/iframe-wrap.js 981 bytes {0} [built]
[46] ./~/sockjs-client/lib/transport/iframe.js 3.83 kB {0} [built]
[47] ./~/json3/lib/json3.js 43.3 kB {0} [built]
[48] (webpack)/buildin/amd-options.js 43 bytes {0} [built]
[49] ./~/sockjs-client/lib/version.js 26 bytes {0} [built]
[50] ./~/sockjs-client/lib/utils/iframe.js 5.04 kB {0} [built]
[51] ./~/sockjs-client/lib/utils/object.js 532 bytes {0} [built]
[52] ./~/sockjs-client/lib/transport/htmlfile.js 710 bytes {0} [built]
[53] ./~/sockjs-client/lib/transport/receiver/htmlfile.js 2.2 kB {0} [built]
[54] ./~/sockjs-client/lib/transport/xhr-polling.js 894 bytes {0} [built]
[55] ./~/sockjs-client/lib/transport/xdr-polling.js 712 bytes {0} [built]
[56] ./~/sockjs-client/lib/transport/jsonp-polling.js 1.02 kB {0} [built]
[57] ./~/sockjs-client/lib/transport/receiver/jsonp.js 5.57 kB {0} [built]
[58] ./~/sockjs-client/lib/transport/sender/jsonp.js 2.46 kB {0} [built]
[59] ./~/sockjs-client/lib/main.js 12 kB {0} [built]
[60] ./~/sockjs-client/lib/shims.js 17.2 kB {0} [built]
[61] ./~/sockjs-client/lib/utils/escape.js 2.36 kB {0} [built]
[62] ./~/sockjs-client/lib/utils/transport.js 1.35 kB {0} [built]
[63] ./~/sockjs-client/lib/utils/log.js 450 bytes {0} [built]
[64] ./~/sockjs-client/lib/event/event.js 477 bytes {0} [built]
[65] ./~/sockjs-client/lib/location.js 178 bytes {0} [built]
[66] ./~/sockjs-client/lib/event/close.js 295 bytes {0} [built]
[67] ./~/sockjs-client/lib/event/trans-message.js 292 bytes {0} [built]
[68] ./~/sockjs-client/lib/info-receiver.js 2.22 kB {0} [built]
[69] ./~/sockjs-client/lib/transport/sender/xhr-fake.js 456 bytes {0} [built]
[70] ./~/sockjs-client/lib/info-iframe.js 1.52 kB {0} [built]
[71] ./~/sockjs-client/lib/info-iframe-receiver.js 791 bytes {0} [built]
[72] ./~/sockjs-client/lib/info-ajax.js 1.03 kB {0} [built]
[73] ./~/sockjs-client/lib/iframe-bootstrap.js 2.9 kB {0} [built]
[74] ./~/sockjs-client/lib/facade.js 723 bytes {0} [built]
[75] (webpack)/hot/dev-server.js 1.85 kB {0} [built]
[76] (webpack)/hot/log-apply-result.js 813 bytes {0} [built]
ERROR in multi app
Module not found: Error: Cannot resolve 'file' or 'directory' ./main.js in D:\Workspace\pact-js\js00\pact-node-example-master\app
# multi app
ERROR in Error: Child compilation failed:
Entry module not found: Error: Cannot resolve 'file' or 'directory' D:\Workspace\pact-js\js00\pact-node-example-master\app\template.html in D:\Workspace\pact-js\js00\pact-node-example-master\app:
Error: Cannot resolve 'file' or 'directory' D:\Workspace\pact-js\js00\pact-node-example-master\app\template.html in D:\Workspace\pact-js\js00\pact-node-example-master\app
- compiler.js:76
[pact-node-example-master]/[html-webpack-plugin]/lib/compiler.js:76:16
- Compiler.js:214 Compiler.
[pact-node-example-master]/[webpack]/lib/Compiler.js:214:10
- Compiler.js:403
[pact-node-example-master]/[webpack]/lib/Compiler.js:403:12
- Tapable.js:67 Compiler.next
[pact-node-example-master]/[tapable]/lib/Tapable.js:67:11
- CachePlugin.js:40 Compiler.
[pact-node-example-master]/[webpack]/lib/CachePlugin.js:40:4
- Tapable.js:71 Compiler.applyPluginsAsync
[pact-node-example-master]/[tapable]/lib/Tapable.js:71:13
- Compiler.js:400 Compiler.
[pact-node-example-master]/[webpack]/lib/Compiler.js:400:9
- Compilation.js:577 Compilation.
[pact-node-example-master]/[webpack]/lib/Compilation.js:577:13
- Tapable.js:60 Compilation.applyPluginsAsync
[pact-node-example-master]/[tapable]/lib/Tapable.js:60:69
- Compilation.js:572 Compilation.
[pact-node-example-master]/[webpack]/lib/Compilation.js:572:10
- Tapable.js:60 Compilation.applyPluginsAsync
[pact-node-example-master]/[tapable]/lib/Tapable.js:60:69
- Compilation.js:567 Compilation.
[pact-node-example-master]/[webpack]/lib/Compilation.js:567:9
- Tapable.js:60 Compilation.applyPluginsAsync
[pact-node-example-master]/[tapable]/lib/Tapable.js:60:69
- Compilation.js:563 Compilation.
[pact-node-example-master]/[webpack]/lib/Compilation.js:563:8
- Tapable.js:60 Compilation.applyPluginsAsync
[pact-node-example-master]/[tapable]/lib/Tapable.js:60:69
- Compilation.js:525 Compilation.seal
[pact-node-example-master]/[webpack]/lib/Compilation.js:525:7
Child html-webpack-plugin for "index.html":
ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' D:\Workspace\pact-js\js00\pact-node-example-master\app\template.html in D:\Workspace\pact-js\js00\pact-node-example-maste
r\app
webpack: Failed to compile.
Finally, i created main.js and Template.html files. And i succeeded in compiling but i dont know what code to implement in my files!!
Thanks a lot

Extracting information from a url path

Let's say that I have a number of URL strings and I want to extract 'meaningful' information from. Namely, I want to know what is the page which that url specifies. So if the site is subaru.com, did this come from the about page, special deals page, etc.
[1] "http://www.subaru.com/vehicles/impreza/index.html"
[2] "http://www.subaru.com/index.html?s_kwcid=subaru&k_clickid=214495e6-dbe0-6668-9222-00003d7cd876&prid=87&k_affcode=76602"
[3] "http://www.subaru.com/index.html?s_kwcid=subaru models&k_clickid=3ec14630-aa7f-b968-c389-00003e9a93f9&prid=87&k_affcode=77236"
[4] "http://www.subaru.com/customer-support.html"
[5] "http://www.subaru.com/"
[6] "http://www.subaru.com/vehicles/forester/index.html"
[7] "http://www.subaru.com/auto-show/detroit-2014.html"
[8] "http://www.subaruofchampaigncounty.com/index.htm"
[9] "http://www.subaru.com/build-your-own/impreza.html?zip=92106"
[10] "http://www.subaru.com/mobile/index.html"
[11] "http://www.subaru.com/"
[12] "http://www.subaru.com/"
[13] "http://www.subaru.com/index.html?s_kwcid=subaru&k_clickid=2361a001-195a-29c8-7323-00003c593714&prid=87&k_affcode=76602"
[14] "http://www.subaru.ru/index"
[15] "http://www.subarugeorgetown.com/certified/subaru/2013-subaru-outback-georgetown-tx-1b523a570a0a00de63937097e2f3723d.htm"
[16] "http://www.subaru.com/"
[17] "http://www.subaru.com/?s_kwcid=suburau&k_clickid=41a2c6dc-c9fa-6ac8-9bf0-000044fe28d7&prid=87&k_affcode=2966&gclid=cprrlygp-rscfugs7aodbkiaaw"
[18] "http://www.subaru.com/mobile/index.html"
[19] "http://www.subaru.com/mobile/index.html"
[20] "http://www.subaru.com/enthusiasts/index.html"
[21] "http://www.subaru.ru/index"
[22] "http://www.subaru.ru/index"
[23] "http://www.subaru.com/mobile/index.html"
[24] "http://www.subaru.com/"
[25] "http://www.subaru.com/"
[26] "http://www.subaru.com/"
[27] "http://www.subaru.com/enthusiasts/index.html"
[28] "http://www.subaruofdayton.com/tcd/home/?tcdkwid=22194961&tcdcmpid=19148&tcdadid=6852747105&locale=en_us"
[29] "http://www.subaru.com/build-your-own/outback.html?sc_brochure=subaru.outback.2014-specifications"
[30] "http://www.subaruofatlanta.com/featured-vehicles/used.htm?reset=inventorylisting"
[31] "http://www.subaru.com/customer-support.html"
[32] "http://www.subarupacific.com/index.htm?cikw=+subaru&cimt=b&cipl=&cinetwork=search&ciagaid=49620691888&gclid=clhf0uoq-rscffpm7aodtv0aiw"
[33] "http://www.subaru.ru/index"
[34] "http://www.subaru.ru/lineup/forester/spec/spec"
[35] "http://www.subaru.com/build-your-own/forester.html?zip=37211"
[36] "http://www.subaru.com/mobile/index.html"
[37] "http://www.subaruelcajon.com/index.htm"
[38] "http://www.subaru.com/customer-support.html"
[39] "http://www.subaru.com/vehicles/brz/index.html?s_kwcid=brz&k_clickid=1ec224f1-18c6-a228-5afb-000047ecef67&prid=87&k_affcode=197257&gclid=cpik35-r-rscfrsffgodhk4ajg"
[40] "http://www.subaru.com/mobile/index.html"
[41] "http://www.subaru.com/mobile/index.html"
[42] "http://www.subaru.ru/index"
[43] "http://www.subaru.com/"
[44] "http://www.subaru.com/vehicles/xv-crosstrek/index.html"
[45] "http://www.subaru.com/customer-support.html"
[46] "http://www.subaru.com/mobile/index.html"
[47] "http://www.subaru.ru/index"
[48] "http://www.subaru.com/index.html?s_kwcid=subaru&k_clickid=293d9ff9-a1ad-8489-82d3-00001e3a514f&prid=87&k_affcode=76602"
[49] "http://www.subaruofkingsautomall.com/index.htm"
[50] "http://www.subaru.com/index.html?s_kwcid=subaru&k_clickid=5ed77da1-f786-55e9-02d1-000055d135fc&prid=87&k_affcode=76602"
[51] "http://www.subaru.com/index.html?s_kwcid=subaru&k_clickid=1645e9d9-05b5-1fe8-d2b1-00002a3ce9e8&prid=87&k_affcode=76602"
[52] "https://www.subaru.com/my-subaru/account.html"
[53] "http://www.subaru.com/index.html?s_kwcid=subaru&k_clickid=0c0e3142-706d-4cc8-830f-00001ba63c96&prid=87&k_affcode=76602"
[54] "http://www.subaru.com/index.html?s_kwcid=subaru&k_clickid=3a594c6a-4485-d2c9-aabf-000051bdfc1d&prid=87&k_affcode=76602"
[55] "http://www.subaru.com/"
[56] "http://www.subaru.com/customer-support.html"
[57] "http://www.subaru.com/build-your-own/index.html"
[58] "http://www.subaru.com/"
[59] "http://www.subaru.com/mobile/index.html"
[60] "http://www.subaru.com/vehicles/brz/photos-videos.html?site=370595&placement=96106620&ad=7514606&creative=0"
[61] "http://www.subaru.com/customer-support.html"
[62] "http://www.subaru.com/"
[63] "http://www.subaru.com/"
[64] "http://www.subaru.com/customer-support.html"
[65] "http://www.subaru.com/mobile/index.html"
[66] "http://www.subaru.com/mobile/index.html"
[67] "http://www.subaru.com/"
[68] "http://www.subaru.com/mobile/index.html"
[69] "http://www.subaru.com/build-your-own/impreza.html?zip=01504"
[70] "http://www.subaru.com/enthusiasts/badge-of-ownership/index.html"
[71] "http://www.subaru.com/"
[72] "http://www.subaru.com/mobile/index.html"
[73] "http://www.subaruofcolumbia.com/used-inventory/index.htm"
[74] "http://www.subaru.com/customer-support.html"
[75] "http://www.subaru.com/"
[76] "http://www.subaruofpuyallup.com/tcd/home/?tcdkwid=22163386&tcdcmpid=13971&tcdadid=35753423988&locale=en_us"
[77] "http://www.subaru.com/mobile/vehicles/forester/index.html"
[78] "http://www.subaru.com/mobile/index.html"
[79] "http://www.subaru.com/"
[80] "http://www.subaru.com/"
As you can see, there's no specific rule I can use to extract just one thing from the URL string because each is different. Furthermore, notice that some have an extension of .ru and not .com. Right now, I've put together the following code but I still want to extract the page (xv-crosstrek, customer-support, etc)
mydat$URL_One <- gsub(".*www\\.([[:alpha:]]+\\.com).*","\\1", mydat$URL)
mydat$URL_Two <- gsub(".*\\.com","", mydat$URL)
Can anyone help with this task?
I'm thinking that I may want to remove all incidents of /index in each URL string.
So for some examples.
before:
"http://www.subaru.com/vehicles/forester/index.html"
after:
forester
before:
http://www.subaruofcolumbia.com/used-inventory/index.htm
after:
used-inventory
before:
http://www.subaru.com/build-your-own/forester.html?zip=37211
after:
build-your-own
There's the httr package, which has the function parse_url. For example, you can do
<r> parse_url("http://www.subaru.com/vehicles/forester/index.html")
$scheme
[1] "http"
$hostname
[1] "www.subaru.com"
$port
NULL
$path
[1] "vehicles/forester/index.html"
$query
NULL
$params
NULL
$fragment
NULL
$username
NULL
$password
NULL
attr(,"class")
[1] "url"
Which perhaps gets you part of the way there.
R has two handy functions for this. basename returns the basename of a url, while dirname returns the directory name (or path). Taking urls to be your first ten urls, I think we can achieve the results you're looking for with the following.
> urls
# [1] "http://www.subaru.com/vehicles/impreza/index.html"
# [2] "http://www.subaru.com/index.html?s_kwcid=subaru&k_clickid=214495e6-dbe0-6668-9222-00003d7cd876&prid=87&k_affcode=76602"
# [3] "http://www.subaru.com/index.html?s_kwcid=subaru models&k_clickid=3ec14630-aa7f-b968-c389-00003e9a93f9&prid=87&k_affcode=77236"
# [4] "http://www.subaru.com/customer-support.html"
# [5] "http://www.subaru.com/"
# [6] "http://www.subaru.com/vehicles/forester/index.html"
# [7] "http://www.subaru.com/auto-show/detroit-2014.html"
# [8] "http://www.subaruofchampaigncounty.com/index.htm"
# [9] "http://www.subaru.com/build-your-own/impreza.html?zip=92106"
# [10] "http://www.subaru.com/mobile/index.html"
> ifelse(grepl('index|zip', basename(urls)),
gsub('^.*/', '', dirname(urls)),
gsub('\\.html', '', basename(urls)))
# [1] "impreza" "www.subaru.com"
# [3] "www.subaru.com" "customer-support"
# [5] "www.subaru.com" "forester"
# [7] "detroit-2014" "www.subaruofchampaigncounty.com"
# [9] "build-your-own" "mobile"

VmSize = physical memory + swap?

I have a little question regarding VmSize, in the documentation it's supposed to be the application's usage of memory.
However on my system:
VmSize = physical memory + swap
VmHWM seems more like what the application actually would be using.
[root#sun ~]# free -m
total used free shared buffers cached
Mem: 12012 9223 2788 0 613 1175
-/+ buffers/cache: 7434 4577
Swap: 3967 0 3967
[root#sun ~]# cat /proc/8268/status
Name: mysqld
State: S (sleeping)
Tgid: 8268
Pid: 8268
PPid: 1
TracerPid: 0
Uid: 89 89 89 89
Gid: 89 89 89 89
FDSize: 512
Groups: 89
VmPeak: 15878128 kB
VmSize: 15878128 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 7036312 kB
VmRSS: 7036312 kB
VmData: 15839272 kB
VmStk: 136 kB
VmExe: 10744 kB
VmLib: 6356 kB
VmPTE: 16208 kB
VmSwap: 0 kB
Threads: 265
SigQ: 0/96048
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000087007
SigIgn: 0000000000001000
SigCgt: 00000001800066e9
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 0000001fffffffff
Seccomp: 0
Cpus_allowed: fff
Cpus_allowed_list: 0-11
Mems_allowed: 00000000,00000001
Mems_allowed_list: 0
voluntary_ctxt_switches: 2567
nonvoluntary_ctxt_switches: 77
Any idea of why?
I try to get the usage of memory for this application in particular but this result doesn't really make sense.
Thanks.
VMsize is the "address space" that the process has in use: the number of available adresses. These addresses do not have to have any physical memory attached to them. (Attached physical memory is the RSS figure)
You can verify this by allocating a chunk of memory with p = malloc(4 * 1024 * 1024);, and not doing anything to *p: the VmSize will increase by 1K pages, but the RSS will be (about) the same. (your program will have more adressable memory, but it does not address it, so the memory does not need to be attached )
VmSize is the sum of all mapped memory (/proc/pid/maps)

Resources