Skip to content

Commit 97a491c

Browse files
committed
updated
1 parent 72ce97f commit 97a491c

4 files changed

Lines changed: 304 additions & 32 deletions

File tree

npm-debug.log

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
0 info it worked if it ends with ok
2+
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'install', 'node' ]
3+
2 info using [email protected]
4+
3 info using [email protected]
5+
4 silly loadCurrentTree Starting
6+
5 silly install loadCurrentTree
7+
6 silly install readLocalPackageData
8+
7 silly fetchPackageMetaData node
9+
8 silly fetchNamedPackageData node
10+
9 silly mapToRegistry name node
11+
10 silly mapToRegistry using default registry
12+
11 silly mapToRegistry registry https://registry.npmjs.org/
13+
12 silly mapToRegistry data Result {
14+
12 silly mapToRegistry raw: 'node',
15+
12 silly mapToRegistry scope: null,
16+
12 silly mapToRegistry escapedName: 'node',
17+
12 silly mapToRegistry name: 'node',
18+
12 silly mapToRegistry rawSpec: '',
19+
12 silly mapToRegistry spec: 'latest',
20+
12 silly mapToRegistry type: 'tag' }
21+
13 silly mapToRegistry uri https://registry.npmjs.org/node
22+
14 verbose get https://registry.npmjs.org/node not expired, no request
23+
15 silly install normalizeTree
24+
16 silly loadCurrentTree Finishing
25+
17 silly loadIdealTree Starting
26+
18 silly install loadIdealTree
27+
19 silly cloneCurrentTree Starting
28+
20 silly install cloneCurrentTreeToIdealTree
29+
21 silly cloneCurrentTree Finishing
30+
22 silly loadShrinkwrap Starting
31+
23 silly install loadShrinkwrap
32+
24 silly loadShrinkwrap Finishing
33+
25 silly loadAllDepsIntoIdealTree Starting
34+
26 silly install loadAllDepsIntoIdealTree
35+
27 silly resolveWithNewModule [email protected] checking installable status
36+
28 silly cache add args [ 'node', null ]
37+
29 verbose cache add spec node
38+
30 silly cache add parsed spec Result {
39+
30 silly cache add raw: 'node',
40+
30 silly cache add scope: null,
41+
30 silly cache add escapedName: 'node',
42+
30 silly cache add name: 'node',
43+
30 silly cache add rawSpec: '',
44+
30 silly cache add spec: 'latest',
45+
30 silly cache add type: 'tag' }
46+
31 silly addNamed node@latest
47+
32 verbose addNamed "latest" is being treated as a dist-tag for node
48+
33 info addNameTag [ 'node', 'latest' ]
49+
34 silly mapToRegistry name node
50+
35 silly mapToRegistry using default registry
51+
36 silly mapToRegistry registry https://registry.npmjs.org/
52+
37 silly mapToRegistry data Result {
53+
37 silly mapToRegistry raw: 'node',
54+
37 silly mapToRegistry scope: null,
55+
37 silly mapToRegistry escapedName: 'node',
56+
37 silly mapToRegistry name: 'node',
57+
37 silly mapToRegistry rawSpec: '',
58+
37 silly mapToRegistry spec: 'latest',
59+
37 silly mapToRegistry type: 'tag' }
60+
38 silly mapToRegistry uri https://registry.npmjs.org/node
61+
39 verbose addNameTag registry:https://registry.npmjs.org/node not in flight; fetching
62+
40 verbose get https://registry.npmjs.org/node not expired, no request
63+
41 silly addNameTag next cb for node with tag latest
64+
42 silly addNamed [email protected]
65+
43 verbose addNamed "9.0.0" is a plain semver version for node
66+
44 silly cache afterAdd [email protected]
67+
45 verbose afterAdd /Users/Franz/.npm/node/9.0.0/package/package.json not in flight; writing
68+
46 verbose correctMkdir /Users/Franz/.npm correctMkdir not in flight; initializing
69+
47 verbose afterAdd /Users/Franz/.npm/node/9.0.0/package/package.json written
70+
48 silly fetchNamedPackageData node-bin-setup
71+
49 silly mapToRegistry name node-bin-setup
72+
50 silly mapToRegistry using default registry
73+
51 silly mapToRegistry registry https://registry.npmjs.org/
74+
52 silly mapToRegistry data Result {
75+
52 silly mapToRegistry raw: 'node-bin-setup',
76+
52 silly mapToRegistry scope: null,
77+
52 silly mapToRegistry escapedName: 'node-bin-setup',
78+
52 silly mapToRegistry name: 'node-bin-setup',
79+
52 silly mapToRegistry rawSpec: '',
80+
52 silly mapToRegistry spec: 'latest',
81+
52 silly mapToRegistry type: 'tag' }
82+
53 silly mapToRegistry uri https://registry.npmjs.org/node-bin-setup
83+
54 verbose get https://registry.npmjs.org/node-bin-setup not expired, no request
84+
55 silly resolveWithNewModule [email protected] checking installable status
85+
56 silly cache add args [ 'node-bin-setup@^1.0.0', null ]
86+
57 verbose cache add spec node-bin-setup@^1.0.0
87+
58 silly cache add parsed spec Result {
88+
58 silly cache add raw: 'node-bin-setup@^1.0.0',
89+
58 silly cache add scope: null,
90+
58 silly cache add escapedName: 'node-bin-setup',
91+
58 silly cache add name: 'node-bin-setup',
92+
58 silly cache add rawSpec: '^1.0.0',
93+
58 silly cache add spec: '>=1.0.0 <2.0.0',
94+
58 silly cache add type: 'range' }
95+
59 silly addNamed node-bin-setup@>=1.0.0 <2.0.0
96+
60 verbose addNamed ">=1.0.0 <2.0.0" is a valid semver range for node-bin-setup
97+
61 silly addNameRange { name: 'node-bin-setup',
98+
61 silly addNameRange range: '>=1.0.0 <2.0.0',
99+
61 silly addNameRange hasData: false }
100+
62 silly mapToRegistry name node-bin-setup
101+
63 silly mapToRegistry using default registry
102+
64 silly mapToRegistry registry https://registry.npmjs.org/
103+
65 silly mapToRegistry data Result {
104+
65 silly mapToRegistry raw: 'node-bin-setup',
105+
65 silly mapToRegistry scope: null,
106+
65 silly mapToRegistry escapedName: 'node-bin-setup',
107+
65 silly mapToRegistry name: 'node-bin-setup',
108+
65 silly mapToRegistry rawSpec: '',
109+
65 silly mapToRegistry spec: 'latest',
110+
65 silly mapToRegistry type: 'tag' }
111+
66 silly mapToRegistry uri https://registry.npmjs.org/node-bin-setup
112+
67 verbose addNameRange registry:https://registry.npmjs.org/node-bin-setup not in flight; fetching
113+
68 verbose get https://registry.npmjs.org/node-bin-setup not expired, no request
114+
69 silly addNameRange number 2 { name: 'node-bin-setup',
115+
69 silly addNameRange range: '>=1.0.0 <2.0.0',
116+
69 silly addNameRange hasData: true }
117+
70 silly addNameRange versions [ 'node-bin-setup',
118+
70 silly addNameRange [ '1.0.0', '1.0.1', '1.0.2', '1.0.3', '1.0.4', '1.0.6' ] ]
119+
71 silly addNamed [email protected]
120+
72 verbose addNamed "1.0.6" is a plain semver version for node-bin-setup
121+
73 silly cache afterAdd [email protected]
122+
74 verbose afterAdd /Users/Franz/.npm/node-bin-setup/1.0.6/package/package.json not in flight; writing
123+
75 verbose correctMkdir /Users/Franz/.npm correctMkdir not in flight; initializing
124+
76 verbose afterAdd /Users/Franz/.npm/node-bin-setup/1.0.6/package/package.json written
125+
77 silly loadAllDepsIntoIdealTree Finishing
126+
78 silly loadIdealTree Finishing
127+
79 silly currentTree [email protected]
128+
80 silly idealTree [email protected]
129+
80 silly idealTree ├── [email protected]
130+
80 silly idealTree └── [email protected]
131+
81 silly generateActionsToTake Starting
132+
82 silly install generateActionsToTake
133+
83 silly generateActionsToTake Finishing
134+
84 silly diffTrees action count 2
135+
85 silly diffTrees add [email protected]
136+
86 silly diffTrees add [email protected]
137+
87 silly decomposeActions action count 16
138+
88 silly decomposeActions fetch [email protected]
139+
89 silly decomposeActions extract [email protected]
140+
90 silly decomposeActions test [email protected]
141+
91 silly decomposeActions preinstall [email protected]
142+
92 silly decomposeActions build [email protected]
143+
93 silly decomposeActions install [email protected]
144+
94 silly decomposeActions postinstall [email protected]
145+
95 silly decomposeActions finalize [email protected]
146+
96 silly decomposeActions fetch [email protected]
147+
97 silly decomposeActions extract [email protected]
148+
98 silly decomposeActions test [email protected]
149+
99 silly decomposeActions preinstall [email protected]
150+
100 silly decomposeActions build [email protected]
151+
101 silly decomposeActions install [email protected]
152+
102 silly decomposeActions postinstall [email protected]
153+
103 silly decomposeActions finalize [email protected]
154+
104 silly runTopLevelLifecycles Starting
155+
105 silly executeActions Starting
156+
106 silly install executeActions
157+
107 silly doSerial global-install 0
158+
108 silly doParallel fetch 2
159+
109 verbose correctMkdir /Users/Franz/.npm/_locks correctMkdir not in flight; initializing
160+
110 verbose lock using /Users/Franz/.npm/_locks/staging-825973c1166fadaf.lock for /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging
161+
111 silly doParallel extract 2
162+
112 silly extract [email protected]
163+
113 silly extract [email protected]
164+
114 verbose unbuild node_modules/.staging/node-bin-setup-54d5521d
165+
115 verbose unbuild node_modules/.staging/node-0e54aac6
166+
116 silly gentlyRm /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-bin-setup-54d5521d is being purged from base /Users/Franz/CS5/JasonCorp84/JavaScript-I
167+
117 verbose gentlyRm don't care about contents; nuking /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-bin-setup-54d5521d
168+
118 verbose tar unpack /Users/Franz/.npm/node-bin-setup/1.0.6/package.tgz
169+
119 verbose tar unpacking to /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-bin-setup-54d5521d
170+
120 silly gentlyRm /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-bin-setup-54d5521d is being purged
171+
121 verbose gentlyRm don't care about contents; nuking /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-bin-setup-54d5521d
172+
122 silly gentlyRm /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6 is being purged from base /Users/Franz/CS5/JasonCorp84/JavaScript-I
173+
123 verbose gentlyRm don't care about contents; nuking /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6
174+
124 silly gunzTarPerm modes [ '775', '664' ]
175+
125 verbose tar unpack /Users/Franz/.npm/node/9.0.0/package.tgz
176+
126 verbose tar unpacking to /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6
177+
127 silly gentlyRm /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6 is being purged
178+
128 verbose gentlyRm don't care about contents; nuking /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6
179+
129 silly gunzTarPerm modes [ '775', '664' ]
180+
130 silly gunzTarPerm extractEntry package.json
181+
131 silly gunzTarPerm modified mode [ 'package.json', 420, 436 ]
182+
132 silly gunzTarPerm extractEntry package.json
183+
133 silly gunzTarPerm modified mode [ 'package.json', 420, 436 ]
184+
134 silly gunzTarPerm extractEntry index.js
185+
135 silly gunzTarPerm modified mode [ 'index.js', 420, 436 ]
186+
136 silly gunzTarPerm extractEntry installArchSpecificPackage.js
187+
137 silly gunzTarPerm modified mode [ 'installArchSpecificPackage.js', 420, 436 ]
188+
138 silly gunzTarPerm extractEntry README.md
189+
139 silly gunzTarPerm modified mode [ 'README.md', 420, 436 ]
190+
140 silly gentlyRm /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-bin-setup-54d5521d/node_modules is being purged
191+
141 verbose gentlyRm don't care about contents; nuking /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-bin-setup-54d5521d/node_modules
192+
142 silly gentlyRm /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6/node_modules is being purged
193+
143 verbose gentlyRm don't care about contents; nuking /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6/node_modules
194+
144 silly doParallel preinstall 2
195+
145 silly preinstall [email protected] /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-bin-setup-54d5521d
196+
146 info lifecycle [email protected]~preinstall: [email protected]
197+
147 silly preinstall [email protected] /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6
198+
148 info lifecycle [email protected]~preinstall: [email protected]
199+
149 silly lifecycle [email protected]~preinstall: no script for preinstall, continuing
200+
150 verbose lifecycle [email protected]~preinstall: unsafe-perm in lifecycle true
201+
151 verbose lifecycle [email protected]~preinstall: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6/node_modules/.bin:/Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.bin:/anaconda/bin:/anaconda/bin:/usr/local/bin:/usr/local/opt/[email protected]/bin:/Users/Franz/.opam/system/bin:/usr/local/sbin:/usr/hla:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/VMware Fusion.app/Contents/Public:/anaconda/bin:/usr/local/opt/[email protected]/bin:/Users/Franz/.opam/system/bin:/usr/local/sbin:/usr/hla:/Users/Franz/.rvm/bin:/Users/Franz/.rvm/bin
202+
152 verbose lifecycle [email protected]~preinstall: CWD: /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging/node-0e54aac6
203+
153 silly lifecycle [email protected]~preinstall: Args: [ '-c', 'node installArchSpecificPackage' ]
204+
154 silly lifecycle [email protected]~preinstall: Returned: code: 1 signal: null
205+
155 info lifecycle [email protected]~preinstall: Failed to exec preinstall script
206+
156 verbose unlock done using /Users/Franz/.npm/_locks/staging-825973c1166fadaf.lock for /Users/Franz/CS5/JasonCorp84/JavaScript-I/node_modules/.staging
207+
157 silly rollbackFailedOptional Starting
208+
158 silly rollbackFailedOptional Finishing
209+
159 silly runTopLevelLifecycles Finishing
210+
160 silly install printInstalled
211+
161 verbose stack Error: [email protected] preinstall: `node installArchSpecificPackage`
212+
161 verbose stack Exit status 1
213+
161 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
214+
161 verbose stack at emitTwo (events.js:106:13)
215+
161 verbose stack at EventEmitter.emit (events.js:191:7)
216+
161 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
217+
161 verbose stack at emitTwo (events.js:106:13)
218+
161 verbose stack at ChildProcess.emit (events.js:191:7)
219+
161 verbose stack at maybeClose (internal/child_process.js:920:16)
220+
161 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
221+
162 verbose pkgid [email protected]
222+
163 verbose cwd /Users/Franz/CS5/JasonCorp84/JavaScript-I
223+
164 error Darwin 16.7.0
224+
165 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node"
225+
166 error node v6.11.3
226+
167 error npm v3.10.10
227+
168 error code ELIFECYCLE
228+
169 error [email protected] preinstall: `node installArchSpecificPackage`
229+
169 error Exit status 1
230+
170 error Failed at the [email protected] preinstall script 'node installArchSpecificPackage'.
231+
170 error Make sure you have the latest version of node.js and npm installed.
232+
170 error If you do, this is most likely a problem with the node package,
233+
170 error not with npm itself.
234+
170 error Tell the author that this fails on your system:
235+
170 error node installArchSpecificPackage
236+
170 error You can get information on how to open an issue for this project with:
237+
170 error npm bugs node
238+
170 error Or if that isn't available, you can get their info via:
239+
170 error npm owner ls node
240+
170 error There is likely additional logging output above.
241+
171 verbose exit [ 1, true ]

src/arrays.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const each = (elements, cb) => {
99
// This only needs to work with arrays.
1010
// You should also pass the index into `cb` as the second argument
1111
// based off http://underscorejs.org/#each
12-
12+
1313
// loop through each element and pass it and the index to callback
1414
for (let i = 0; i < elements.length; i++) {
1515
cb(elements[i], i);
@@ -19,7 +19,7 @@ const each = (elements, cb) => {
1919
const map = (elements, cb) => {
2020
// Produces a new array of values by mapping each value in list through a transformation function (iteratee).
2121
// Return the new array.
22-
22+
2323
// //initialize empty array
2424
// const mappedValues = [];
2525
// //loop through each element in elements and pass it to cb and push that to the empty array
@@ -29,7 +29,7 @@ const map = (elements, cb) => {
2929
// return mappedValues;
3030
// };
3131

32-
//take the elements from callback used in each() and push them into newArr
32+
// take the elements from callback used in each() and push them into newArr
3333
const newArr = [];
3434
each(elements, (elem, i) => {
3535
newArr.push(cb(elem, i));
@@ -41,31 +41,28 @@ const reduce = (elements, cb, startingValue) => {
4141
// Elements will be passed one by one into `cb` along with the `startingValue`.
4242
// `startingValue` should be the first argument passed to `cb` and the array element should be the second argument.
4343
// `startingValue` is the starting value. If `startingValue` is undefined then make `elements[0]` the initial value.
44-
45-
//creates a copy of, not a pointer to, elements
44+
// creates a copy of, not a pointer to, elements
4645
const elementsCopy = elements.slice();
47-
//create a memory space for a default or initial value since it can vary between an arbitrary value or undefined
46+
// create a memory space for a default or initial value since it can vary between an arbitrary value or undefined
4847
// can use ternary statement but it's better practice to stay away from them: if (startingValue === undefined) ? elements[0] : startingValue;
4948
let memo = startingValue || elementsCopy.shift();
5049
each(elementsCopy, (item) => {
5150
// more closure here
5251
memo = cb(memo, item);
5352
});
5453
return memo;
54+
};
5555

5656
const find = (elements, cb) => {
5757
// Look through each value in `elements` and pass each element to `cb`.
5858
// If `cb` returns `true` then return that element.
5959
// Return `undefined` if no elements pass the truth test.
6060

61-
//loop through each element and check if it equals item.
61+
// loop through each element and check if it equals item.
6262
for (let i = 0; i < elements.length; i++) {
63-
if (elements[i] === item) {
64-
//if element is equal to item pass true to cb else false = undefined
63+
if (elements[i]) {
64+
// if element is equal to item pass true to cb else false = undefined
6565
cb(true);
66-
} else {
67-
cb(false);
68-
}
6966
}
7067
return undefined;
7168
};
@@ -87,6 +84,16 @@ const filter = (elements, cb) => {
8784
const flatten = (elements) => {
8885
// Flattens a nested array (the nesting can be to any depth).
8986
// Example: flatten([1, [2], [3, [[4]]]]); => [1, 2, 3, 4];
87+
/* flattenedArray
88+
loop over elements;
89+
if element is not an array
90+
push element into array
91+
else return flattened function (recursion)
92+
return flattenedArray; */
93+
const flattenedArray = reduce(elements, (prev, next) => {
94+
if (Array.isArray(next)) return prev.concat(flatten(next));
95+
return prev.concat(next);
96+
}, [],);
9097
};
9198

9299
/* eslint-enable no-unused-vars, max-len */
@@ -98,4 +105,4 @@ module.exports = {
98105
find,
99106
filter,
100107
flatten,
101-
};
108+
};

src/callbacks.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,21 @@ module.exports = {
6767
contains,
6868
removeDuplicates,
6969
};
70+
71+
72+
const pairs = (obj) => {
73+
// Convert an object into a list of [key, value] pairs.
74+
// http://underscorejs.org/#pairs
75+
// return Object.entries(obj);
76+
const objKeys = Object.keys(obj);
77+
const objValues = Object.values(obj);
78+
const arrOfPairs = [];
79+
let pair = [];
80+
for (let i = 0; i < objKeys.length; i++) {
81+
pair.push(objKeys[i], objValues[i]);
82+
arrOfPairs.push(pair);
83+
pair = [];
84+
}
85+
// returns list of tuples
86+
return arrOfPairs;
87+
};

0 commit comments

Comments
 (0)