How to get file path from user using Powershell Read-Host? - string

I am trying to get file path from user using Read-Host and check if such a file is present in that location or not.
$choice = Read-Host -Prompt 'Do you like to run the flyway command?[yes:no]'
if($choice -eq 'yes'){
[string]$fileToCheck = Read-Host -Prompt 'Enter the path to the flyway configuration file. For example C:\Users\admin\Desktop\flyway.conf'
if(Test-Path $fileToCheck -PathType leaf){
mvn -Dflyway.configFiles=$fileToCheck flyway:info
mvn -Dflyway.configFiles=$fileToCheck flyway:migrate
mvn -Dflyway.configFiles=$fileToCheck flyway:info
}
else{
Write-Host 'Flyway configuration file not present. Enter correct path.'
}
}
When the maven command gets executed, i get the following error.
Enter the path to the flyway configuration file. For example C:\Users\admin\Desktop\flyway.conf: C:\Users\akshay\Desktop\flyway.conf
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Progress (1): 2.2/14 kB
Progress (1): 5.0/14 kB
Progress (1): 7.8/14 kB
Progress (1): 11/14 kB
Progress (2): 11/14 kB | 2.3/20 kB
Progress (2): 11/14 kB | 5.0/20 kB
Progress (2): 11/14 kB | 7.8/20 kB
Progress (2): 11/14 kB | 11/20 kB
Progress (2): 13/14 kB | 11/20 kB
Progress (2): 14 kB | 11/20 kB
Progress (2): 14 kB | 13/20 kB
Progress (2): 14 kB | 16/20 kB
Progress (2): 14 kB | 19/20 kB
Progress (2): 14 kB | 20 kB
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (14 kB at 12 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 kB at 18 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.037 s
[INFO] Finished at: 2020-03-23T17:08:53+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix '.configFiles=C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] availa
ble from the repositories [local (C:\Users\akshay\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
I am unable to use the complete path of the file for the argument flyway.configFiles. Only C gets appended there.

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

SIGBUS while doing memcpy from mmap ed buffer which is in RAM as identified by mincore

I am mmapping a block as:
mapAddr = mmap((void*) 0, curMapSize, PROT_NONE, MAP_LOCKED|MAP_SHARED, fd, curMapOffset);
if this does not fail (mapAddr != MAP_FAILED) I query mincore as:
err = mincore((char*) mapAddr, pageSize, &mincoreRet);
to find out whether it is in RAM. In case it is in RAM (err == 0 && mincoreRet & 0x01) I mmap it again for reading as:
copyAddr = mmap((void*) 0, curMapSize, PROT_READ, MAP_LOCKED|MAP_SHARED, fd, curMapOffset);
and then I try to copy it out to my buffer as:
memcpy(data, copyAddr, pageSize);
everything works fine except in the last memcpy once in a while I get SIGBUS. When I check /proc/ /smaps at the time of the failure I notice that it has Rss as well as Locked fields as 0 as listed below:
7f4a4c118000-7f4a4c119000 r--s 00326000 00:17 6 <file name>
Size: 4 kB
Rss: 0 kB
Pss: 0 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 0 kB
Referenced: 0 kB
Anonymous: 0 kB
AnonHugePages: 0 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 0 kB
Any thoughts? This is happening on ubuntu 12.0.4 with kernel version 3.5.0-36.

What does pss mean in /proc/pid/smaps

I was confused about the Pss column in /proc/pid/smaps, so I wrote a program to test it:
void sa();
int main(int argc,char *argv[])
{
int fd;
sa();
sleep(1000);
}
void sa()
{
char *pi=new char[1024*1024*10];
for(int i=0;i<4;++i) {
for(int j=0;j<1024*1024;++j){
*pi='o';
pi++;
}
}
int cnt;
for(int i=0;i<6;++i) {
for(int j=0;j<1024*1024;++j){
cnt+=*pi;
pi++;
}
}
printf("%d",cnt);
}
$cat /proc/`pidof testprogram`/smaps
08838000-0885b000 rw-p 00000000 00:00 0 [heap]
Size: 140 kB
Rss: 12 kB
Pss: 12 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 12 kB
Referenced: 12 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
b6dcd000-b77d0000 rw-p 00000000 00:00 0
Size: 10252 kB
Rss: 10252 kB
Pss: 4108 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 4108 kB
Referenced: 4108 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Here I found Pss equal to Private_Dirty, but I wonder why.
BTW: Is there any detailed documentation for smaps?
Quoting from lwn.net
The "proportional set size" (PSS) of a process is the count of pages
it has in memory, where each page is divided by the number of
processes sharing it. So if a process has 1000 pages all to itself,
and 1000 shared with one other process, its PSS will be 1500
From Linux Kernel Documentation,
The /proc/PID/smaps is an extension based on maps, showing the memory
consumption for each of the process's mappings. For each of mappings there
is a series of lines such as the following:
08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
Size: 1084 kB
Rss: 892 kB
Pss: 374 kB
Shared_Clean: 892 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 0 kB
Referenced: 892 kB
Anonymous: 0 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 374 kB
The first of these lines shows the same information as is displayed
for the mapping in /proc/PID/maps. The remaining lines show the size
of the mapping (size), the amount of the mapping that is currently
resident in RAM (RSS), the process' proportional share of this mapping
(PSS), the number of clean and dirty private pages in the mapping.
Note that even a page which is part of a MAP_SHARED mapping, but has
only a single pte mapped, i.e. is currently used by only one process,
is accounted as private and not as shared. "Referenced" indicates the
amount of memory currently marked as referenced or accessed.
"Anonymous" shows the amount of memory that does not belong to any
file. Even a mapping associated with a file may contain anonymous
pages: when MAP_PRIVATE and a page is modified, the file page is
replaced by a private anonymous copy. "Swap" shows how much
would-be-anonymous memory is also used, but out on swap.
This Question on Unix and Linux Stackexchange covers almost the topic. See Mat's excellent answer which will surely clear all your doubts.

Resources