質問編集履歴

11

エラーログを追記

2019/12/14 20:11

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -427,3 +427,35 @@
427
427
 
428
428
 
429
429
  `browserify /Users/north/Desktop/sample.js /Users/north/Desktop/sample2.js -t [babelify --presets es2015] -o /Users/north/Desktop/sample4.js`
430
+
431
+
432
+
433
+ (上記のエラーのエラーメッセージ)
434
+
435
+ ```
436
+
437
+ Error: .presets must be an array, or undefined while parsing file: /Users/north/Desktop/sample.js
438
+
439
+ at assertArray (/Users/north/Desktop/node_modules/@babel/core/lib/config/validation/option-assertions.js:150:11)
440
+
441
+ at assertPluginList (/Users/north/Desktop/node_modules/@babel/core/lib/config/validation/option-assertions.js:219:15)
442
+
443
+ at /Users/north/Desktop/node_modules/@babel/core/lib/config/validation/options.js:107:5
444
+
445
+ at Array.forEach (<anonymous>)
446
+
447
+ at validateNested (/Users/north/Desktop/node_modules/@babel/core/lib/config/validation/options.js:83:21)
448
+
449
+ at validate (/Users/north/Desktop/node_modules/@babel/core/lib/config/validation/options.js:74:10)
450
+
451
+ at loadPrivatePartialConfig (/Users/north/Desktop/node_modules/@babel/core/lib/config/partial.js:66:50)
452
+
453
+ at Object.loadPartialConfig (/Users/north/Desktop/node_modules/@babel/core/lib/config/partial.js:110:18)
454
+
455
+ at transform (/Users/north/Desktop/node_modules/babelify/index.js:157:17)
456
+
457
+ at BabelifyStream._flush (/Users/north/Desktop/node_modules/babelify/index.js:138:5)
458
+
459
+
460
+
461
+ ```

10

修正したファイルとコマンドを追記

2019/12/14 20:11

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -372,4 +372,58 @@
372
372
 
373
373
  ```babel:
374
374
 
375
- stdin compilation requires either -f/--filename [filename] or --no-babelrc```
375
+ stdin compilation requires either -f/--filename [filename] or --no-babelrc
376
+
377
+ ```
378
+
379
+
380
+
381
+ ####20191215追記
382
+
383
+ (package.json)
384
+
385
+ ```
386
+
387
+ {
388
+
389
+ "name": "desktop",
390
+
391
+ "version": "1.0.0",
392
+
393
+ "description": "",
394
+
395
+ "main": "sample.js",
396
+
397
+ "dependencies": {},
398
+
399
+ "devDependencies": {
400
+
401
+ "@babel/cli": "^7.7.4",
402
+
403
+ "@babel/core": "^7.7.4",
404
+
405
+ "@babel/preset-env": "^7.7.4",
406
+
407
+ "babelify": "^10.0.0"
408
+
409
+ },
410
+
411
+ "scripts": {
412
+
413
+ "test": "echo \"Error: no test specified\" && exit 1"
414
+
415
+ },
416
+
417
+ "author": "",
418
+
419
+ "license": "ISC"
420
+
421
+ }
422
+
423
+ ```
424
+
425
+ (エラーになるコマンド)
426
+
427
+
428
+
429
+ `browserify /Users/north/Desktop/sample.js /Users/north/Desktop/sample2.js -t [babelify --presets es2015] -o /Users/north/Desktop/sample4.js`

9

エラー表示を追記

2019/12/14 19:56

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -363,3 +363,13 @@
363
363
  npm WARN desktop@1.0.0 No repository field.
364
364
 
365
365
  up to date in 0.851sfound 0 vulnerabilities`
366
+
367
+
368
+
369
+ ####20191214追記
370
+
371
+ (npx babelによるエラー)
372
+
373
+ ```babel:
374
+
375
+ stdin compilation requires either -f/--filename [filename] or --no-babelrc```

8

試したことを追記

2019/12/13 23:01

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -342,4 +342,24 @@
342
342
 
343
343
  at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
344
344
 
345
+
346
+
347
+ ###追記20191208
348
+
349
+ (行ったこと)
350
+
351
+ ・デスクトップ上のnode_modules と package-lock.json を削除
352
+
353
+ ・「npm install」実行
354
+
355
+
356
+
357
+ (npm install実行時のエラー)
358
+
345
359
  `
360
+
361
+ npm WARN desktop@1.0.0 No description
362
+
363
+ npm WARN desktop@1.0.0 No repository field.
364
+
365
+ up to date in 0.851sfound 0 vulnerabilities`

7

試したことを更新

2019/12/07 20:22

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -273,3 +273,73 @@
273
273
  })
274
274
 
275
275
  ```
276
+
277
+
278
+
279
+ ###追記20191207
280
+
281
+ (package.json)※場所:デスクトップ
282
+
283
+ ```
284
+
285
+ "dependencies": {},
286
+
287
+ "devDependencies": {
288
+
289
+ "@babel/cli": "^7.7.4",
290
+
291
+ "@babel/core": "^7.7.4",
292
+
293
+ "@babel/preset-env": "^7.7.4",
294
+
295
+ "babelify": "^10.0.0"
296
+
297
+ },
298
+
299
+ ```
300
+
301
+
302
+
303
+ (.babelrc) ※場所:デスクトップ
304
+
305
+ ```
306
+
307
+ // {
308
+
309
+ // "presets": ["es2015"]
310
+
311
+ // }
312
+
313
+ {
314
+
315
+ "presets": [
316
+
317
+ [
318
+
319
+ "@babel/preset-env",
320
+
321
+ {
322
+
323
+ "useBuiltIns": "entry" // 任意
324
+
325
+ }
326
+
327
+ ]
328
+
329
+ ]
330
+
331
+ }
332
+
333
+ ```
334
+
335
+
336
+
337
+ (browserifyコマンド実行時のエラー)
338
+
339
+ `Error: SyntaxError: Unexpected token : in JSON at position 14 while parsing json file /Users/north/Desktop/package.json
340
+
341
+ at /usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:550:30
342
+
343
+ at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
344
+
345
+ `

6

作成したファイルの中身を追記

2019/12/07 04:42

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -216,112 +216,60 @@
216
216
 
217
217
  (Babelコマンドインストール時のエラー)
218
218
 
219
- ```
220
-
221
- /usr/local/bin/babel-doctor -> /usr/local/lib/node_modules/babel-cli/bin/babel-doctor.js
222
-
223
- /usr/local/bin/babel-node -> /usr/local/lib/node_modules/babel-cli/bin/babel-node.js
224
-
225
- /usr/local/bin/babel -> /usr/local/lib/node_modules/babel-cli/bin/babel.js
226
-
227
- /usr/local/bin/babel-external-helpers -> /usr/local/lib/node_modules/babel-cli/bin/babel-external-helpers.js
228
-
229
-
230
-
231
- > fsevents@1.2.9 install /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
232
-
233
- > node install
234
-
235
-
236
-
237
- node-pre-gyp WARN Using needle for node-pre-gyp https download
238
-
239
- node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.9 and node@12.13.1 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
240
-
241
- node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib'
242
-
243
- gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/north/Library/Caches/node-gyp/12.13.1"
244
-
245
- gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/.node-gyp"
246
-
247
- gyp WARN install got an error, rolling back install
248
-
249
- gyp WARN install got an error, rolling back install
250
-
251
- gyp ERR! configure error
252
-
253
- gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/.node-gyp'
254
-
255
- gyp ERR! System Darwin 17.7.0
256
-
257
- gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
258
-
259
- gyp ERR! cwd /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
260
-
261
- gyp ERR! node -v v12.13.1
262
-
263
- gyp ERR! node-gyp -v v5.0.5
264
-
265
- gyp ERR! not ok
266
-
267
- node-pre-gyp ERR! build error
268
-
269
- node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
270
-
271
- node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
272
-
273
- node-pre-gyp ERR! stack at ChildProcess.emit (events.js:210:5)
274
-
275
- node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
276
-
277
- node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
278
-
279
- node-pre-gyp ERR! System Darwin 17.7.0
280
-
281
- node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
282
-
283
- node-pre-gyp ERR! cwd /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
284
-
285
- node-pre-gyp ERR! node -v v12.13.1
286
-
287
- node-pre-gyp ERR! node-pre-gyp -v v0.12.0
288
-
289
- node-pre-gyp ERR! not ok
290
-
291
- Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
292
-
293
-
294
-
295
- > core-js@2.6.10 postinstall /usr/local/lib/node_modules/babel-cli/node_modules/core-js
296
-
297
- > node postinstall || echo "ignore"
298
-
299
-
300
-
301
- Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
302
-
303
-
304
-
305
- The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
306
-
307
- > https://opencollective.com/core-js
308
-
309
- > https://www.patreon.com/zloirock
310
-
311
-
312
-
313
- Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
314
-
315
-
316
-
317
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/babel-cli/node_modules/fsevents):
318
-
319
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 install: `node install`
320
-
321
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
322
-
323
-
324
-
325
- + babel-cli@6.26.0
326
-
327
- ```
219
+ →文字数オーバーのため削除
220
+
221
+
222
+
223
+ ###追記20191203
224
+
225
+ (package.json) ※場所:デスクトップ
226
+
227
+ ```
228
+
229
+ {
230
+
231
+ "name": "desktop",
232
+
233
+ "version": "1.0.0",
234
+
235
+ "description": "",
236
+
237
+ "main": "sample.js",
238
+
239
+ "dependencies": {
240
+
241
+ "babel-loader": "^8.0.6",
242
+
243
+ "babel-preset-es2015": "^6.24.1",
244
+
245
+ "webpack": "^4.41.2"
246
+
247
+ },
248
+
249
+ "devDependencies": {},
250
+
251
+ "scripts": {
252
+
253
+ "test": "echo \"Error: no test specified\" && exit 1"
254
+
255
+ },
256
+
257
+ "author": "",
258
+
259
+ "license": "ISC"
260
+
261
+ }
262
+
263
+
264
+
265
+ ```
266
+
267
+ (.babelrc) ※場所:デスクトップ
268
+
269
+ ```({
270
+
271
+ "presets": ["es2015"]
272
+
273
+ })
274
+
275
+ ```

5

新たに行った内容を追記

2019/12/02 23:36

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -191,3 +191,137 @@
191
191
 
192
192
 
193
193
  関係がないかもしれませんが、今は全てデスクトップ上でBrowserifyを動かそうとしていますが、それよりも早い時期に`/usr/local/lib/node_modules/`にBabelをインストールしていますが、それはBabel7をデスクトップにインストールする上で関係ないと思ってもいいでしょうか。
194
+
195
+
196
+
197
+ ##追記
198
+
199
+ (行ったこと)
200
+
201
+ ・node_modulesディレクトリ(デスクトップ、/usr/local/libの2つとも)の削除
202
+
203
+ ・Babel(本体+コマンド)、browserifyの削除
204
+
205
+ ・node.jsインストール
206
+
207
+ ・Babelインストール(コマンドはグローバルインストール、本体はデスクトップにインストール)※コマンドインストール時にエラー発生、インストール自体は成功
208
+
209
+ ・.babelrc作成
210
+
211
+ ・browserifyグローバルインストール
212
+
213
+ ・[このサイト](https://babeljs.io/docs/en/env/)を参考にコマンド`npm install @babel/preset-env`を実行
214
+
215
+
216
+
217
+ (Babelコマンドインストール時のエラー)
218
+
219
+ ```
220
+
221
+ /usr/local/bin/babel-doctor -> /usr/local/lib/node_modules/babel-cli/bin/babel-doctor.js
222
+
223
+ /usr/local/bin/babel-node -> /usr/local/lib/node_modules/babel-cli/bin/babel-node.js
224
+
225
+ /usr/local/bin/babel -> /usr/local/lib/node_modules/babel-cli/bin/babel.js
226
+
227
+ /usr/local/bin/babel-external-helpers -> /usr/local/lib/node_modules/babel-cli/bin/babel-external-helpers.js
228
+
229
+
230
+
231
+ > fsevents@1.2.9 install /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
232
+
233
+ > node install
234
+
235
+
236
+
237
+ node-pre-gyp WARN Using needle for node-pre-gyp https download
238
+
239
+ node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.9 and node@12.13.1 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
240
+
241
+ node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib'
242
+
243
+ gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/north/Library/Caches/node-gyp/12.13.1"
244
+
245
+ gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/.node-gyp"
246
+
247
+ gyp WARN install got an error, rolling back install
248
+
249
+ gyp WARN install got an error, rolling back install
250
+
251
+ gyp ERR! configure error
252
+
253
+ gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/.node-gyp'
254
+
255
+ gyp ERR! System Darwin 17.7.0
256
+
257
+ gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
258
+
259
+ gyp ERR! cwd /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
260
+
261
+ gyp ERR! node -v v12.13.1
262
+
263
+ gyp ERR! node-gyp -v v5.0.5
264
+
265
+ gyp ERR! not ok
266
+
267
+ node-pre-gyp ERR! build error
268
+
269
+ node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
270
+
271
+ node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
272
+
273
+ node-pre-gyp ERR! stack at ChildProcess.emit (events.js:210:5)
274
+
275
+ node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
276
+
277
+ node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
278
+
279
+ node-pre-gyp ERR! System Darwin 17.7.0
280
+
281
+ node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
282
+
283
+ node-pre-gyp ERR! cwd /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
284
+
285
+ node-pre-gyp ERR! node -v v12.13.1
286
+
287
+ node-pre-gyp ERR! node-pre-gyp -v v0.12.0
288
+
289
+ node-pre-gyp ERR! not ok
290
+
291
+ Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
292
+
293
+
294
+
295
+ > core-js@2.6.10 postinstall /usr/local/lib/node_modules/babel-cli/node_modules/core-js
296
+
297
+ > node postinstall || echo "ignore"
298
+
299
+
300
+
301
+ Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
302
+
303
+
304
+
305
+ The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
306
+
307
+ > https://opencollective.com/core-js
308
+
309
+ > https://www.patreon.com/zloirock
310
+
311
+
312
+
313
+ Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
314
+
315
+
316
+
317
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/babel-cli/node_modules/fsevents):
318
+
319
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 install: `node install`
320
+
321
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
322
+
323
+
324
+
325
+ + babel-cli@6.26.0
326
+
327
+ ```

4

試したことの内容の追記

2019/11/27 22:19

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -148,4 +148,46 @@
148
148
 
149
149
 
150
150
 
151
+ 改めて`npm auditの結果`の結果です。
152
+
153
+
154
+
155
+ (npm auditの結果)
156
+
157
+ ```
158
+
159
+ ───────────────┬──────────────────────────────────────────────────────────────┐
160
+
161
+ │ Low │ Regular Expression Denial of Service │
162
+
163
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
164
+
165
+ │ Package │ braces │
166
+
167
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
168
+
169
+ │ Patched in │ >=2.3.1 │
170
+
171
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
172
+
173
+ │ Dependency of │ babel-cli │
174
+
175
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
176
+
177
+ │ Path │ babel-cli > chokidar > anymatch > micromatch > braces │
178
+
179
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
180
+
181
+ │ More info │ https://npmjs.com/advisories/786 │
182
+
183
+ └───────────────┴──────────────────────────────────────────────────────────────┘
184
+
185
+ ```
186
+
187
+
188
+
189
+ 今回も`npm audit fix`を実行してもBabelのバージョンは6のままで変わっていません。
190
+
191
+
192
+
151
193
  関係がないかもしれませんが、今は全てデスクトップ上でBrowserifyを動かそうとしていますが、それよりも早い時期に`/usr/local/lib/node_modules/`にBabelをインストールしていますが、それはBabel7をデスクトップにインストールする上で関係ないと思ってもいいでしょうか。

3

試したことの内容を追記

2019/11/18 05:47

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -95,3 +95,57 @@
95
95
  run `npm audit fix` to fix them, or `npm audit` for details
96
96
 
97
97
  ```
98
+
99
+
100
+
101
+ ##(追記2:)
102
+
103
+ デスクトップにBabel7をインストールしようとしたのでデスクトップ上にBabelが作成されると思っていたためインストールに失敗したと思いましたが、デスクトップ上のnode_modulesディレクトリ内に作成されたのかもしれないと思い当たりました。
104
+
105
+ しかし、`babel --version`でBabelバージョンを確認すると`6.26.0 (babel-core 6.26.3)`なのでバージョンは変わっていませんでした。
106
+
107
+ 次に`npm audit`を実行しました。
108
+
109
+
110
+
111
+ (npm auditの結果)
112
+
113
+ ```
114
+
115
+ Low │ Regular Expression Denial of Service │
116
+
117
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
118
+
119
+ │ Package │ braces │
120
+
121
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
122
+
123
+ │ Patched in │ >=2.3.1 │
124
+
125
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
126
+
127
+ │ Dependency of │ babel-cli │
128
+
129
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
130
+
131
+ │ Path │ babel-cli > chokidar > anymatch > micromatch > braces │
132
+
133
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
134
+
135
+ │ More info │ https://npmjs.com/advisories/786
136
+
137
+ ```
138
+
139
+
140
+
141
+ `npm audit fix`を実行してもBabelのバージョンは6のままでした。
142
+
143
+
144
+
145
+
146
+
147
+ インストール前から既にnode_modulesディレクトリが存在し、その中に古いBabelが存在していたためにBabel7が正常にインストールできなかったのかもと思い、node_modulesディレクトリの中のbabelと名がつくファイルやディレクトリ(babelifyディレクトリは除く)を全て削除し、再度Babel7をインストールするためのコマンドを実行しましたが、Babelのバージョンは6のまま変わっていませんでした。
148
+
149
+
150
+
151
+ 関係がないかもしれませんが、今は全てデスクトップ上でBrowserifyを動かそうとしていますが、それよりも早い時期に`/usr/local/lib/node_modules/`にBabelをインストールしていますが、それはBabel7をデスクトップにインストールする上で関係ないと思ってもいいでしょうか。

2

アドバイスいただいた内容を元に実行した内容を追記

2019/11/18 05:45

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -55,3 +55,43 @@
55
55
  at Function.Module._load (internal/modules/cjs/loader.js:585:3)
56
56
 
57
57
  ```
58
+
59
+
60
+
61
+ ##(追記:)
62
+
63
+ ###Babel7をインストールするために行なったコマンド(→インストール不可))
64
+
65
+ ```
66
+
67
+ npm install --save-dev @babel/core @babel/cli @babel/preset-env
68
+
69
+ ```
70
+
71
+ [インストールのための参考サイト](https://chaika.hatenablog.com/entry/2018/11/21/150000)
72
+
73
+
74
+
75
+ ###エラーメッセージ
76
+
77
+ ```
78
+
79
+ npm WARN desktop@1.0.0 No description
80
+
81
+ npm WARN desktop@1.0.0 No repository field.
82
+
83
+
84
+
85
+ + @babel/cli@7.7.0
86
+
87
+ + @babel/core@7.7.2
88
+
89
+ + @babel/preset-env@7.7.1
90
+
91
+ updated 3 packages and audited 6616 packages in 5.261s
92
+
93
+ found 1 low severity vulnerability
94
+
95
+ run `npm audit fix` to fix them, or `npm audit` for details
96
+
97
+ ```

1

エラーメッセージ追記

2019/11/14 20:29

投稿

theplace
theplace

スコア24

test CHANGED
File without changes
test CHANGED
@@ -15,3 +15,43 @@
15
15
 
16
16
 
17
17
  最初、デスクトップにpackage.jsonがなかったので`npm init`でpackage.jsonを作りましたが、特に関係がなかったようです。
18
+
19
+
20
+
21
+ (エラーメッセージ)
22
+
23
+ ```
24
+
25
+ /Users/north/Desktop/node_modules/babelify/index.js:16
26
+
27
+ throw err;
28
+
29
+ ^
30
+
31
+
32
+
33
+ Error: Cannot find module '@babel/core'
34
+
35
+ babelify@10 requires Babel 7.x (the package '@babel/core'). If you'd like to use Babel 6.x ('babel-core'), you should install 'babelify@8'.
36
+
37
+ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
38
+
39
+ at Function.Module._load (internal/modules/cjs/loader.js:562:25)
40
+
41
+ at Module.require (internal/modules/cjs/loader.js:692:17)
42
+
43
+ at require (internal/modules/cjs/helpers.js:25:18)
44
+
45
+ at Object.<anonymous> (/Users/north/Desktop/node_modules/babelify/index.js:9:11)
46
+
47
+ at Module._compile (internal/modules/cjs/loader.js:778:30)
48
+
49
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
50
+
51
+ at Module.load (internal/modules/cjs/loader.js:653:32)
52
+
53
+ at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
54
+
55
+ at Function.Module._load (internal/modules/cjs/loader.js:585:3)
56
+
57
+ ```