This question already has answers here:
Cannot find module coa/compile.js
(6 answers)
Closed 1 year ago.
I bought a new pc today.
I installed the latest reccomanded version of NodeJS, installed npm.
I checked if they are installed correctly using the node -v and npm -v and i can see
Node:
v16.13.0
npm:
8.1.0
Then tried to build a new react app with the command npx create-react-app test-app. I tried this, then tried to install it globally but i had the same feedback from the error.
So the problem is:
When i lunch the command create-react-app, it crashes giving me this error back. Anyone can explain me what is happening?
The error starts at row 111
Thanks everyone!
0 verbose cli [
0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'install',
0 verbose cli '-g',
0 verbose cli 'coa'
0 verbose cli ]
1 info using npm#8.1.0
2 info using node#v16.13.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 4ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 4ms
6 timing config:load:builtin Completed in 5ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\Luca\Desktop\Progetti\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\Amministratore\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\Amministratore\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 18ms
19 timing npm:load:configload Completed in 18ms
20 timing npm:load:setTitle Completed in 1ms
21 timing npm:load:setupLog Completed in 0ms
22 timing config:load:flatten Completed in 5ms
23 timing npm:load:cleanupLog Completed in 3ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 0ms
26 timing npm:load Completed in 30ms
27 timing arborist:ctor Completed in 2ms
28 timing idealTree:init Completed in 9ms
29 timing idealTree:userRequests Completed in 4ms
30 silly idealTree buildDeps
31 silly fetch manifest coa#*
32 http fetch GET 200 https://registry.npmjs.org/coa 76ms (cache hit)
33 silly placeDep ROOT coa#3.1.3 OK for: want: *
34 silly fetch manifest #types/q#^1.5.1
35 silly fetch manifest chalk#^2.4.1
36 silly fetch manifest q#^1.1.2
37 http fetch GET 200 https://registry.npmjs.org/#types%2fq 24ms (cache hit)
38 http fetch GET 200 https://registry.npmjs.org/chalk 24ms (cache hit)
39 http fetch GET 200 https://registry.npmjs.org/q 28ms (cache hit)
40 timing idealTree:#root Completed in 130ms
41 silly placeDep node_modules/coa #types/q#1.5.5 OK for: coa#3.1.3 want: ^1.5.1
42 silly placeDep node_modules/coa chalk#2.4.2 OK for: coa#3.1.3 want: ^2.4.1
43 silly placeDep node_modules/coa q#1.5.1 OK for: coa#3.1.3 want: ^1.1.2
44 silly fetch manifest ansi-styles#^3.2.1
45 silly fetch manifest escape-string-regexp#^1.0.5
46 silly fetch manifest supports-color#^5.3.0
47 http fetch GET 200 https://registry.npmjs.org/ansi-styles 24ms (cache hit)
48 http fetch GET 200 https://registry.npmjs.org/supports-color 24ms (cache hit)
49 http fetch GET 200 https://registry.npmjs.org/escape-string-regexp 28ms (cache hit)
50 timing idealTree:node_modules/coa Completed in 44ms
51 timing idealTree:node_modules/coa/node_modules/#types/q Completed in 0ms
52 silly placeDep node_modules/coa ansi-styles#3.2.1 OK for: chalk#2.4.2 want: ^3.2.1
53 silly placeDep node_modules/coa escape-string-regexp#1.0.5 OK for: chalk#2.4.2 want: ^1.0.5
54 silly placeDep node_modules/coa supports-color#5.5.0 OK for: chalk#2.4.2 want: ^5.3.0
55 silly fetch manifest color-convert#^1.9.0
56 silly fetch manifest has-flag#^3.0.0
57 http fetch GET 200 https://registry.npmjs.org/color-convert 21ms (cache hit)
58 http fetch GET 200 https://registry.npmjs.org/has-flag 23ms (cache hit)
59 timing idealTree:node_modules/coa/node_modules/chalk Completed in 44ms
60 silly placeDep node_modules/coa color-convert#1.9.3 OK for: ansi-styles#3.2.1 want: ^1.9.0
61 silly fetch manifest color-name#1.1.3
62 http fetch GET 200 https://registry.npmjs.org/color-name 12ms (cache hit)
63 timing idealTree:node_modules/coa/node_modules/ansi-styles Completed in 18ms
64 silly placeDep node_modules/coa color-name#1.1.3 OK for: color-convert#1.9.3 want: 1.1.3
65 timing idealTree:node_modules/coa/node_modules/color-convert Completed in 3ms
66 timing idealTree:node_modules/coa/node_modules/color-name Completed in 1ms
67 timing idealTree:node_modules/coa/node_modules/escape-string-regexp Completed in 0ms
68 timing idealTree:node_modules/coa/node_modules/q Completed in 0ms
69 silly placeDep node_modules/coa has-flag#3.0.0 OK for: supports-color#5.5.0 want: ^3.0.0
70 timing idealTree:node_modules/coa/node_modules/supports-color Completed in 2ms
71 timing idealTree:node_modules/coa/node_modules/has-flag Completed in 0ms
72 timing idealTree:buildDeps Completed in 245ms
73 timing idealTree:fixDepFlags Completed in 2ms
74 timing idealTree Completed in 262ms
75 timing reify:loadTrees Completed in 269ms
76 timing reify:diffTrees Completed in 3ms
77 silly reify moves {}
78 timing reify:retireShallow Completed in 1ms
79 timing reify:createSparse Completed in 9ms
80 timing reify:loadBundles Completed in 0ms
81 silly audit bulk request {
81 silly audit coa: [ '3.1.3' ],
81 silly audit '#types/q': [ '1.5.5' ],
81 silly audit chalk: [ '2.4.2' ],
81 silly audit q: [ '1.5.1' ],
81 silly audit 'ansi-styles': [ '3.2.1' ],
81 silly audit 'escape-string-regexp': [ '1.0.5' ],
81 silly audit 'supports-color': [ '5.5.0' ],
81 silly audit 'color-convert': [ '1.9.3' ],
81 silly audit 'color-name': [ '1.1.3' ],
81 silly audit 'has-flag': [ '3.0.0' ]
81 silly audit }
82 silly tarball no local data for coa#https://registry.npmjs.org/coa/-/coa-3.1.3.tgz. Extracting by manifest.
83 timing reifyNode:node_modules/coa/node_modules/escape-string-regexp Completed in 188ms
84 timing reifyNode:node_modules/coa/node_modules/ansi-styles Completed in 189ms
85 timing reifyNode:node_modules/coa/node_modules/has-flag Completed in 191ms
86 timing reifyNode:node_modules/coa/node_modules/supports-color Completed in 192ms
87 timing reifyNode:node_modules/coa/node_modules/#types/q Completed in 194ms
88 timing reifyNode:node_modules/coa/node_modules/color-name Completed in 198ms
89 timing reifyNode:node_modules/coa/node_modules/q Completed in 199ms
90 timing reifyNode:node_modules/coa/node_modules/chalk Completed in 199ms
91 timing reifyNode:node_modules/coa/node_modules/color-convert Completed in 200ms
92 http fetch GET 200 https://registry.npmjs.org/coa/-/coa-3.1.3.tgz 223ms (cache miss)
93 timing reifyNode:node_modules/coa Completed in 287ms
94 timing reify:unpack Completed in 287ms
95 timing reify:unretire Completed in 0ms
96 timing build:queue Completed in 6ms
97 info run coa#3.1.3 preinstall node_modules/coa start /B node compile.js & node compile.js
98 info run coa#3.1.3 preinstall { code: 1, signal: null }
99 timing reify:rollback:createSparse Completed in 27ms
100 timing reify:rollback:retireShallow Completed in 0ms
101 timing command:install Completed in 762ms
102 verbose stack Error: command failed
102 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:64:27)
102 verbose stack at ChildProcess.emit (node:events:390:28)
102 verbose stack at maybeClose (node:internal/child_process:1064:16)
102 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
103 verbose pkgid coa#3.1.3
104 verbose cwd C:\Users\Luca\Desktop\Progetti
105 verbose Windows_NT 10.0.19042
106 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "coa"
107 verbose node v16.13.0
108 verbose npm v8.1.0
109 error code 1
110 error path C:\Users\Amministratore\AppData\Roaming\npm\node_modules\coa
111 error command failed
112 error command C:\Windows\system32\cmd.exe /d /s /c start /B node compile.js & node compile.js
113 error node:internal/modules/cjs/loader:936
113 error throw err;
113 error ^
113 error
113 error Error: Cannot find module 'C:\Users\Amministratore\AppData\Roaming\npm\node_modules\coa\compile.js'
113 error at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
113 error at Function.Module._load (node:internal/modules/cjs/loader:778:27)
113 error at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
113 error at node:internal/main/run_main_module:17:47 {
113 error code: 'MODULE_NOT_FOUND',
113 error requireStack: []
113 error }
113 error node:internal/modules/cjs/loader:936
113 error throw err;
113 error ^
113 error
113 error Error: Cannot find module 'C:\Users\Amministratore\AppData\Roaming\npm\node_modules\coa\compile.js'
113 error at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
113 error at Function.Module._load (node:internal/modules/cjs/loader:778:27)
113 error at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
113 error at node:internal/main/run_main_module:17:47 {
113 error code: 'MODULE_NOT_FOUND',
113 error requireStack: []
113 error }
114 verbose exit 1
It's working now!
COA got compromised but is now back up again without the malicious code inside.
Check https://github.com/veged/coa/issues/99 for more info.
Related
I have been referring https://www.npmjs.com/package/eslint to configure eslint to my express project and when i'm installing eslint package i'm getting an error as following
npm ERR! Unexpected end of JSON input while parsing near '.../ajv-1.4.2.tgz"}},"1.'
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\Ramitha\AppData\Roaming\npm-cache_logs\2018-07-17T06_22_50_551Z-debug.log
package.json
{
"name": "name",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "nodemon index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.3",
"nodemon": "^1.18.2"
}
}
2018-07-17T06_22_50_551Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'eslint',
1 verbose cli '-g' ]
2 info using npm#5.6.0
3 info using node#v8.11.3
4 verbose npm-session 54a68bf0918c64f2
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/eslint 42ms (from cache)
8 silly pacote tag manifest for eslint#latest fetched in 123ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule eslint#5.1.0 checking installable status
14 http fetch GET 200 https://registry.npmjs.org/ajv 185ms (from cache)
15 http fetch GET 200 https://registry.npmjs.org/babel-code-frame 180ms (from cache)
16 http fetch GET 200 https://registry.npmjs.org/debug 179ms (from cache)
17 http fetch GET 200 https://registry.npmjs.org/eslint-scope 178ms (from cache)
18 http fetch GET 200 https://registry.npmjs.org/doctrine 179ms (from cache)
19 http fetch GET 200 https://registry.npmjs.org/cross-spawn 181ms (from cache)
20 silly fetchPackageMetaData error for ajv#^6.5.0 Unexpected end of JSON input while parsing near '.../ajv-1.4.2.tgz"}},"1.'
21 http fetch GET 200 https://registry.npmjs.org/eslint-utils 194ms (from cache)
22 silly pacote range manifest for debug#^3.1.0 fetched in 198ms
23 silly resolveWithNewModule debug#3.1.0 checking installable status
24 silly pacote range manifest for babel-code-frame#^6.26.0 fetched in 207ms
25 silly resolveWithNewModule babel-code-frame#6.26.0 checking installable status
26 silly pacote range manifest for eslint-scope#^4.0.0 fetched in 200ms
27 silly resolveWithNewModule eslint-scope#4.0.0 checking installable status
28 silly pacote range manifest for doctrine#^2.1.0 fetched in 201ms
29 silly resolveWithNewModule doctrine#2.1.0 checking installable status
30 silly pacote range manifest for cross-spawn#^6.0.5 fetched in 205ms
31 silly resolveWithNewModule cross-spawn#6.0.5 checking installable status
32 http fetch GET 200 https://registry.npmjs.org/eslint-visitor-keys 254ms (from cache)
33 http fetch GET 200 https://registry.npmjs.org/espree 254ms (from cache)
34 silly pacote range manifest for eslint-utils#^1.3.1 fetched in 259ms
35 silly resolveWithNewModule eslint-utils#1.3.1 checking installable status
36 silly pacote range manifest for eslint-visitor-keys#^1.0.0 fetched in 320ms
37 silly resolveWithNewModule eslint-visitor-keys#1.0.0 checking installable status
38 silly pacote range manifest for espree#^4.0.0 fetched in 323ms
39 silly resolveWithNewModule espree#4.0.0 checking installable status
40 http fetch GET 200 https://registry.npmjs.org/esquery 236ms (from cache)
41 http fetch GET 200 https://registry.npmjs.org/file-entry-cache 223ms (from cache)
42 http fetch GET 200 https://registry.npmjs.org/glob 222ms (from cache)
43 http fetch GET 200 https://registry.npmjs.org/functional-red-black-tree 223ms (from cache)
44 http fetch GET 200 https://registry.npmjs.org/esutils 228ms (from cache)
45 http fetch GET 200 https://registry.npmjs.org/globals 228ms (from cache)
46 silly pacote range manifest for esquery#^1.0.1 fetched in 248ms
47 silly resolveWithNewModule esquery#1.0.1 checking installable status
48 http fetch GET 200 https://registry.npmjs.org/ignore 172ms (from cache)
49 silly pacote range manifest for file-entry-cache#^2.0.0 fetched in 236ms
50 silly resolveWithNewModule file-entry-cache#2.0.0 checking installable status
51 silly pacote range manifest for functional-red-black-tree#^1.0.1 fetched in 237ms
52 silly resolveWithNewModule functional-red-black-tree#1.0.1 checking installable status
53 silly pacote range manifest for glob#^7.1.2 fetched in 238ms
54 silly resolveWithNewModule glob#7.1.2 checking installable status
55 silly pacote range manifest for esutils#^2.0.2 fetched in 242ms
56 silly resolveWithNewModule esutils#2.0.2 checking installable status
57 silly pacote range manifest for globals#^11.7.0 fetched in 242ms
58 silly resolveWithNewModule globals#11.7.0 checking installable status
59 http fetch GET 200 https://registry.npmjs.org/inquirer 117ms (from cache)
60 silly fetchPackageMetaData error for inquirer#^5.2.0 Unexpected end of JSON input while parsing near '...":"^2.1.0","gulp-plum'
61 silly pacote range manifest for ignore#^3.3.3 fetched in 189ms
62 silly resolveWithNewModule ignore#3.3.10 checking installable status
63 http fetch GET 200 https://registry.npmjs.org/is-resolvable 31ms (from cache)
64 http fetch GET 200 https://registry.npmjs.org/js-yaml 30ms (from cache)
65 http fetch GET 200 https://registry.npmjs.org/json-stable-stringify-without-jsonify 29ms (from cache)
66 http fetch GET 200 https://registry.npmjs.org/lodash 27ms (from cache)
67 http fetch GET 200 https://registry.npmjs.org/levn 29ms (from cache)
68 http fetch GET 200 https://registry.npmjs.org/mkdirp 24ms (from cache)
69 silly pacote range manifest for is-resolvable#^1.1.0 fetched in 40ms
70 silly resolveWithNewModule is-resolvable#1.1.0 checking installable status
71 silly pacote range manifest for js-yaml#^3.11.0 fetched in 38ms
72 silly resolveWithNewModule js-yaml#3.12.0 checking installable status
73 http fetch GET 200 https://registry.npmjs.org/natural-compare 25ms (from cache)
74 silly pacote range manifest for json-stable-stringify-without-jsonify#^1.0.1 fetched in 35ms
75 silly resolveWithNewModule json-stable-stringify-without-jsonify#1.0.1 checking installable status
76 silly pacote range manifest for lodash#^4.17.5 fetched in 34ms
77 silly resolveWithNewModule lodash#4.17.10 checking installable status
78 silly pacote range manifest for levn#^0.3.0 fetched in 38ms
79 silly resolveWithNewModule levn#0.3.0 checking installable status
80 silly pacote range manifest for mkdirp#^0.5.1 fetched in 34ms
81 silly resolveWithNewModule mkdirp#0.5.1 checking installable status
82 silly pacote range manifest for natural-compare#^1.4.0 fetched in 36ms
83 silly resolveWithNewModule natural-compare#1.4.0 checking installable status
84 http fetch GET 200 https://registry.npmjs.org/optionator 21ms (from cache)
85 http fetch GET 200 https://registry.npmjs.org/pluralize 24ms (from cache)
86 http fetch GET 200 https://registry.npmjs.org/progress 24ms (from cache)
87 http fetch GET 200 https://registry.npmjs.org/regexpp 21ms (from cache)
88 silly pacote range manifest for optionator#^0.8.2 fetched in 29ms
89 silly resolveWithNewModule optionator#0.8.2 checking installable status
90 silly pacote range manifest for pluralize#^7.0.0 fetched in 28ms
91 silly resolveWithNewModule pluralize#7.0.0 checking installable status
92 http fetch GET 200 https://registry.npmjs.org/require-uncached 21ms (from cache)
93 silly pacote range manifest for regexpp#^1.1.0 fetched in 27ms
94 silly resolveWithNewModule regexpp#1.1.0 checking installable status
95 silly pacote range manifest for progress#^2.0.0 fetched in 32ms
96 silly resolveWithNewModule progress#2.0.0 checking installable status
97 silly pacote range manifest for require-uncached#^1.0.3 fetched in 29ms
98 silly resolveWithNewModule require-uncached#1.0.3 checking installable status
99 http fetch GET 200 https://registry.npmjs.org/string.prototype.matchall 37ms (from cache)
100 http fetch GET 200 https://registry.npmjs.org/table 39ms (from cache)
101 silly pacote range manifest for string.prototype.matchall#^2.0.0 fetched in 47ms
102 silly resolveWithNewModule string.prototype.matchall#2.0.0 checking installable status
103 silly fetchPackageMetaData error for table#^4.0.3 Unexpected end of JSON input while parsing near '...8eba","tarball":"http'
104 http fetch GET 200 https://registry.npmjs.org/text-table 48ms (from cache)
105 silly pacote range manifest for text-table#^0.2.0 fetched in 50ms
106 silly resolveWithNewModule text-table#0.2.0 checking installable status
107 http fetch GET 304 https://registry.npmjs.org/chalk 578ms (from cache)
108 silly pacote range manifest for chalk#^2.1.0 fetched in 586ms
109 silly resolveWithNewModule chalk#2.4.1 checking installable status
110 http fetch GET 304 https://registry.npmjs.org/imurmurhash 320ms (from cache)
111 http fetch GET 304 https://registry.npmjs.org/semver 160ms (from cache)
112 silly pacote range manifest for imurmurhash#^0.1.4 fetched in 325ms
113 silly resolveWithNewModule imurmurhash#0.1.4 checking installable status
114 silly pacote range manifest for semver#^5.5.0 fetched in 166ms
115 silly resolveWithNewModule semver#5.5.0 checking installable status
116 http fetch GET 304 https://registry.npmjs.org/path-is-inside 185ms (from cache)
117 silly pacote range manifest for path-is-inside#^1.0.2 fetched in 191ms
118 silly resolveWithNewModule path-is-inside#1.0.2 checking installable status
119 http fetch GET 304 https://registry.npmjs.org/strip-ansi 168ms (from cache)
120 http fetch GET 304 https://registry.npmjs.org/minimatch 229ms (from cache)
121 silly pacote range manifest for strip-ansi#^4.0.0 fetched in 174ms
122 silly resolveWithNewModule strip-ansi#4.0.0 checking installable status
123 silly pacote range manifest for minimatch#^3.0.4 fetched in 238ms
124 silly resolveWithNewModule minimatch#3.0.4 checking installable status
125 http fetch GET 304 https://registry.npmjs.org/strip-json-comments 178ms (from cache)
126 silly pacote range manifest for strip-json-comments#^2.0.1 fetched in 183ms
127 silly resolveWithNewModule strip-json-comments#2.0.1 checking installable status
128 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '.../ajv-1.4.2.tgz"}},"1.'
128 verbose stack at JSON.parse (<anonymous>)
128 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
128 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
128 verbose stack at <anonymous>
128 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
129 verbose cwd C:\Users\Ramitha\Desktop\Projects\backend
130 verbose Windows_NT 10.0.15063
131 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "eslint" "-g"
132 verbose node v8.11.3
133 verbose npm v5.6.0
134 error Unexpected end of JSON input while parsing near '.../ajv-1.4.2.tgz"}},"1.'
135 verbose exit [ 1, true ]
How can I accomplish this ? Please help me out
I got to fix the error by deleting the contents of the npm-cache_logs folder which is in C:\Users\Ramitha\AppData\Roaming\npm-cache_logs and re-installing the eslint module
npm cache clean --force
solved the problem for me
I'm having this error while deploying stack of CA.
Error: Failed to find private key for certificate in
'/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem':
Could not find matching private key for SKI: Failed getting key for
SKI [[21 208 34 108 92 98 114 142 23 136 0 189 188 55 155 135 23 90
147 173 157 62 155 19 173 212 128 3 175 212 121 41]]: Key with SKI
15d0226c5c62728e178800bdbc379b87175a93ad9d3e9b13add48003afd47929 not
found in /etc/hyperledger/fabric-ca-server/msp/keystore
I have made sure that key is same as "crypto-config/peerOrganizations/org1.example.com/ca" in yml file. But still its throwing error.. Any idea about this?
Within the docker run command, are you placing the secret key inside curly brackets such as this?
FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/{15d0226c5c62728e178800bdbc379b87175a93ad9d3e9b13add48003afd47929}
If so, the cause of your error is that this isn't the correct path. Remove the brackets to make the path complete.
I'm learning J and have modified a tutorial into a jconsole script invoked by ./knight.j N to return as output the Knight's tour for an NxN board.
#!/usr/local/bin/j
kmoves=: 3 : 0
t=. (>,{;~i.y) +"1/ _2]\2 1 2 _1 1 2 1 _2 _1 2 _1 _2 _2 1 _2 _1
(*./"1 t e. i.y) <##"1 y#.t
)
ktour=: 3 : 0
M=. >kmoves y
p=. k=. 0
b=. 1 $~ *:y
for. i.<:*:y do.
b=. 0 k}b
p=. p,k=. ((i.<./) +/"1 b{~j{M){j=. ({&b # ]) k{M
end.
assert. ~:p
(,~y)$/:p
)
echo ktour 0".>2}.ARGV
exit''
However, I'm having difficulty in handling ARGV for numbers greater than 9. The script works correctly with single digit input:
$ ./knight.j 8
0 25 14 23 28 49 12 31
15 22 27 50 13 30 63 48
26 1 24 29 62 59 32 11
21 16 51 58 43 56 47 60
2 41 20 55 52 61 10 33
17 38 53 42 57 44 7 46
40 3 36 19 54 5 34 9
37 18 39 4 35 8 45 6
But fails on double digit input:
$ ./knight.j 10
|length error: kmoves
| (*./"1 t e.i.y)<##"1 y #.t
ARGV
┌─────────────────┬──────────┬──┐
│/Users/v64/.bin/j│./knight.j│10│
└─────────────────┴──────────┴──┘
It works if I separate the digits of the parameter into different arguments:
$ ./knight.j 1 0
0 17 96 67 14 19 84 35 12 21
99 64 15 18 97 68 13 20 37 34
16 1 98 95 66 85 36 83 22 11
63 92 65 86 81 94 69 72 33 38
2 87 90 93 76 71 82 39 10 23
91 62 53 78 89 80 75 70 73 32
44 3 88 61 52 77 40 59 24 9
47 50 45 54 79 60 27 74 31 58
4 43 48 51 6 41 56 29 8 25
49 46 5 42 55 28 7 26 57 30
ARGV
┌─────────────────┬──────────┬─┬─┐
│/Users/v64/.bin/j│./knight.j│1│0│
└─────────────────┴──────────┴─┴─┘
I understand conceptually why this works, but I can't figure out how to modify the script to accept "10" as a single argument.
Thanks for the additional information on ARGV.I think the issue is that 0 ". > 2}. ARGV is a list of length 1 when '10' is the third box and an atom with shape empty when '9' is in the third box.
ARGV=: '/Users/v64/.bin/j';'./knight.j';'10'
ARGV
┌─────────────────┬──────────┬──┐
│/Users/v64/.bin/j│./knight.j│10│
└─────────────────┴──────────┴──┘
$ 0 ".>2}. ARGV NB. 1 item list
1
0 ".>2}. ARGV
10
ARGV=: '/Users/v64/.bin/j';'./knight.j';'9'
$ 0 ".>2}. ARGV NB. atom with empty shape
0 ".>2}. ARGV
9
You can change the shape of the '10' result by using {. on the length 1 list to make it an atom and I think you will find that your verb now works for double digits.
ARGV=: '/Users/v64/.bin/j';'./knight.j';'10'
ARGV
┌─────────────────┬──────────┬──┐
│/Users/v64/.bin/j│./knight.j│10│
└─────────────────┴──────────┴──┘
$ {. 0 ".>2}. ARGV NB. Atom with empty shape
{. 0 ".>2}. ARGV
10
I don't imagine this was the reason that you expected, but it does happen from time to time that results that look like atoms are actually 1 item lists which can result in length errors.
Hope this helps.
I have been using the clustergram feature in Matlab on my data in the following way;
Cobj2 = clustergram(c,'RowLabels',[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40],'ColumnLabels',{'Value1','Value2','Value3','Value4','Value5','Value6'},'Colormap',redbluecmap,'Standardize',1)
Matlab sorts my data into clusters and although I have found the dendogram and heatmap informative I would like to find out a little more information about my clusters for example the euclidean distances between them or some other measure so I can determine their 'strength'. Is there a way to get more information or statistics about my graph?
This question already has answers here:
Calculate Percentile in Excel 2010
(3 answers)
Closed 9 years ago.
I am trying to calculate how many calls came back in 95 percentile of time. Below is my Result Set. I am working with Excel 2010
Milliseconds Number
0 1702
1 15036
2 14262
3 13190
4 9137
5 5635
6 3742
7 2628
8 1899
9 1298
10 963
11 727
12 503
13 415
14 311
15 235
16 204
17 140
18 109
19 83
20 72
21 55
22 52
23 35
24 33
25 25
26 15
27 18
28 14
29 15
30 13
31 19
32 23
33 19
34 21
35 20
36 25
37 26
38 13
39 12
40 10
41 17
42 6
43 7
44 8
45 4
46 7
47 9
48 11
49 12
50 9
51 9
52 9
53 8
54 10
55 10
56 11
57 3
58 7
59 7
60 2
61 5
62 7
63 5
64 5
65 2
66 3
67 2
68 1
70 1
71 2
72 1
73 4
74 1
75 1
76 1
77 3
80 1
81 1
85 1
87 2
93 1
96 1
100 1
107 1
112 1
116 1
125 1
190 1
356 1
450 1
492 1
497 1
554 1
957 1
Just some background what does above information means-
1702 calls came back in 0 milliseconds
15036 calls came back in 1 milliseconds
14262 calls came back in 2 milliseconds
etc etc
So to calculate the 95th percentile from the above data, I am using this formula in excel 2010-
=PERCENTILE.EXC(IF(TRANSPOSE(ROW(INDIRECT("1:"&MAX(H$2:H$96))))<=H$2:H$96,A$2:A$96),0.95)
Can anyone help me whether the way I am doing in Excel 2010 is right or not?
I am getting 95th percentile as 10 by using the above scenario.
Thanks for the help.
that's essentially the same question you asked here and the formula I suggested. As per my last comments in that question - that formula should work OK as long as you use CTRL+SHIFT+ENTER correctly. I get 10 as the answer for this example using that formula.
I think you can verify manually that that is indeed the correct answer. If you have a running total in an adjacent column then you can see where the 95th percentile is reached......