teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

11

エラーログを追記

2019/12/14 20:11

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -212,4 +212,20 @@
212
212
  ```
213
213
  (エラーになるコマンド)
214
214
 
215
- `browserify /Users/north/Desktop/sample.js /Users/north/Desktop/sample2.js -t [babelify --presets es2015] -o /Users/north/Desktop/sample4.js`
215
+ `browserify /Users/north/Desktop/sample.js /Users/north/Desktop/sample2.js -t [babelify --presets es2015] -o /Users/north/Desktop/sample4.js`
216
+
217
+ (上記のエラーのエラーメッセージ)
218
+ ```
219
+ Error: .presets must be an array, or undefined while parsing file: /Users/north/Desktop/sample.js
220
+ at assertArray (/Users/north/Desktop/node_modules/@babel/core/lib/config/validation/option-assertions.js:150:11)
221
+ at assertPluginList (/Users/north/Desktop/node_modules/@babel/core/lib/config/validation/option-assertions.js:219:15)
222
+ at /Users/north/Desktop/node_modules/@babel/core/lib/config/validation/options.js:107:5
223
+ at Array.forEach (<anonymous>)
224
+ at validateNested (/Users/north/Desktop/node_modules/@babel/core/lib/config/validation/options.js:83:21)
225
+ at validate (/Users/north/Desktop/node_modules/@babel/core/lib/config/validation/options.js:74:10)
226
+ at loadPrivatePartialConfig (/Users/north/Desktop/node_modules/@babel/core/lib/config/partial.js:66:50)
227
+ at Object.loadPartialConfig (/Users/north/Desktop/node_modules/@babel/core/lib/config/partial.js:110:18)
228
+ at transform (/Users/north/Desktop/node_modules/babelify/index.js:157:17)
229
+ at BabelifyStream._flush (/Users/north/Desktop/node_modules/babelify/index.js:138:5)
230
+
231
+ ```

10

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

2019/12/14 20:11

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -185,4 +185,31 @@
185
185
  ####20191214追記
186
186
  (npx babelによるエラー)
187
187
  ```babel:
188
- stdin compilation requires either -f/--filename [filename] or --no-babelrc```
188
+ stdin compilation requires either -f/--filename [filename] or --no-babelrc
189
+ ```
190
+
191
+ ####20191215追記
192
+ (package.json)
193
+ ```
194
+ {
195
+ "name": "desktop",
196
+ "version": "1.0.0",
197
+ "description": "",
198
+ "main": "sample.js",
199
+ "dependencies": {},
200
+ "devDependencies": {
201
+ "@babel/cli": "^7.7.4",
202
+ "@babel/core": "^7.7.4",
203
+ "@babel/preset-env": "^7.7.4",
204
+ "babelify": "^10.0.0"
205
+ },
206
+ "scripts": {
207
+ "test": "echo \"Error: no test specified\" && exit 1"
208
+ },
209
+ "author": "",
210
+ "license": "ISC"
211
+ }
212
+ ```
213
+ (エラーになるコマンド)
214
+
215
+ `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

title CHANGED
File without changes
body CHANGED
@@ -180,4 +180,9 @@
180
180
  `
181
181
  npm WARN desktop@1.0.0 No description
182
182
  npm WARN desktop@1.0.0 No repository field.
183
- up to date in 0.851sfound 0 vulnerabilities`
183
+ up to date in 0.851sfound 0 vulnerabilities`
184
+
185
+ ####20191214追記
186
+ (npx babelによるエラー)
187
+ ```babel:
188
+ stdin compilation requires either -f/--filename [filename] or --no-babelrc```

8

試したことを追記

2019/12/13 23:01

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -170,4 +170,14 @@
170
170
  `Error: SyntaxError: Unexpected token : in JSON at position 14 while parsing json file /Users/north/Desktop/package.json
171
171
  at /usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:550:30
172
172
  at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
173
+
174
+ ###追記20191208
175
+ (行ったこと)
176
+ ・デスクトップ上のnode_modules と package-lock.json を削除
177
+ ・「npm install」実行
178
+
179
+ (npm install実行時のエラー)
173
- `
180
+ `
181
+ npm WARN desktop@1.0.0 No description
182
+ npm WARN desktop@1.0.0 No repository field.
183
+ up to date in 0.851sfound 0 vulnerabilities`

7

試したことを更新

2019/12/07 20:22

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -135,4 +135,39 @@
135
135
  ```({
136
136
  "presets": ["es2015"]
137
137
  })
138
- ```
138
+ ```
139
+
140
+ ###追記20191207
141
+ (package.json)※場所:デスクトップ
142
+ ```
143
+ "dependencies": {},
144
+ "devDependencies": {
145
+ "@babel/cli": "^7.7.4",
146
+ "@babel/core": "^7.7.4",
147
+ "@babel/preset-env": "^7.7.4",
148
+ "babelify": "^10.0.0"
149
+ },
150
+ ```
151
+
152
+ (.babelrc) ※場所:デスクトップ
153
+ ```
154
+ // {
155
+ // "presets": ["es2015"]
156
+ // }
157
+ {
158
+ "presets": [
159
+ [
160
+ "@babel/preset-env",
161
+ {
162
+ "useBuiltIns": "entry" // 任意
163
+ }
164
+ ]
165
+ ]
166
+ }
167
+ ```
168
+
169
+ (browserifyコマンド実行時のエラー)
170
+ `Error: SyntaxError: Unexpected token : in JSON at position 14 while parsing json file /Users/north/Desktop/package.json
171
+ at /usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:550:30
172
+ at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
173
+ `

6

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

2019/12/07 04:42

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -107,58 +107,32 @@
107
107
  ・[このサイト](https://babeljs.io/docs/en/env/)を参考にコマンド`npm install @babel/preset-env`を実行
108
108
 
109
109
  (Babelコマンドインストール時のエラー)
110
+ →文字数オーバーのため削除
111
+
112
+ ###追記20191203
113
+ (package.json) ※場所:デスクトップ
110
114
  ```
115
+ {
116
+ "name": "desktop",
117
+ "version": "1.0.0",
118
+ "description": "",
119
+ "main": "sample.js",
120
+ "dependencies": {
111
- /usr/local/bin/babel-doctor -> /usr/local/lib/node_modules/babel-cli/bin/babel-doctor.js
121
+ "babel-loader": "^8.0.6",
112
- /usr/local/bin/babel-node -> /usr/local/lib/node_modules/babel-cli/bin/babel-node.js
122
+ "babel-preset-es2015": "^6.24.1",
123
+ "webpack": "^4.41.2"
124
+ },
125
+ "devDependencies": {},
126
+ "scripts": {
113
- /usr/local/bin/babel -> /usr/local/lib/node_modules/babel-cli/bin/babel.js
127
+ "test": "echo \"Error: no test specified\" && exit 1"
128
+ },
129
+ "author": "",
114
- /usr/local/bin/babel-external-helpers -> /usr/local/lib/node_modules/babel-cli/bin/babel-external-helpers.js
130
+ "license": "ISC"
131
+ }
115
132
 
116
- > fsevents@1.2.9 install /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
117
- > node install
118
-
119
- node-pre-gyp WARN Using needle for node-pre-gyp https download
120
- 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)
121
- node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib'
122
- gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/north/Library/Caches/node-gyp/12.13.1"
123
- gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/.node-gyp"
124
- gyp WARN install got an error, rolling back install
125
- gyp WARN install got an error, rolling back install
126
- gyp ERR! configure error
127
- gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/.node-gyp'
128
- gyp ERR! System Darwin 17.7.0
129
- 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"
130
- gyp ERR! cwd /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
131
- gyp ERR! node -v v12.13.1
132
- gyp ERR! node-gyp -v v5.0.5
133
- gyp ERR! not ok
134
- node-pre-gyp ERR! build error
135
- 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)
136
- 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)
137
- node-pre-gyp ERR! stack at ChildProcess.emit (events.js:210:5)
138
- node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
139
- node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
140
- node-pre-gyp ERR! System Darwin 17.7.0
141
- 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"
142
- node-pre-gyp ERR! cwd /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
143
- node-pre-gyp ERR! node -v v12.13.1
144
- node-pre-gyp ERR! node-pre-gyp -v v0.12.0
145
- node-pre-gyp ERR! not ok
146
- 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)
147
-
148
- > core-js@2.6.10 postinstall /usr/local/lib/node_modules/babel-cli/node_modules/core-js
149
- > node postinstall || echo "ignore"
150
-
151
- Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
152
-
153
- The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
154
- > https://opencollective.com/core-js
155
- > https://www.patreon.com/zloirock
156
-
157
- Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
158
-
159
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/babel-cli/node_modules/fsevents):
160
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 install: `node install`
161
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
162
-
163
- + babel-cli@6.26.0
133
+ ```
134
+ (.babelrc) ※場所:デスクトップ
135
+ ```({
136
+ "presets": ["es2015"]
137
+ })
164
138
  ```

5

新たに行った内容を追記

2019/12/02 23:36

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -94,4 +94,71 @@
94
94
 
95
95
  今回も`npm audit fix`を実行してもBabelのバージョンは6のままで変わっていません。
96
96
 
97
- 関係がないかもしれませんが、今は全てデスクトップ上でBrowserifyを動かそうとしていますが、それよりも早い時期に`/usr/local/lib/node_modules/`にBabelをインストールしていますが、それはBabel7をデスクトップにインストールする上で関係ないと思ってもいいでしょうか。
97
+ 関係がないかもしれませんが、今は全てデスクトップ上でBrowserifyを動かそうとしていますが、それよりも早い時期に`/usr/local/lib/node_modules/`にBabelをインストールしていますが、それはBabel7をデスクトップにインストールする上で関係ないと思ってもいいでしょうか。
98
+
99
+ ##追記
100
+ (行ったこと)
101
+ ・node_modulesディレクトリ(デスクトップ、/usr/local/libの2つとも)の削除
102
+ ・Babel(本体+コマンド)、browserifyの削除
103
+ ・node.jsインストール
104
+ ・Babelインストール(コマンドはグローバルインストール、本体はデスクトップにインストール)※コマンドインストール時にエラー発生、インストール自体は成功
105
+ ・.babelrc作成
106
+ ・browserifyグローバルインストール
107
+ ・[このサイト](https://babeljs.io/docs/en/env/)を参考にコマンド`npm install @babel/preset-env`を実行
108
+
109
+ (Babelコマンドインストール時のエラー)
110
+ ```
111
+ /usr/local/bin/babel-doctor -> /usr/local/lib/node_modules/babel-cli/bin/babel-doctor.js
112
+ /usr/local/bin/babel-node -> /usr/local/lib/node_modules/babel-cli/bin/babel-node.js
113
+ /usr/local/bin/babel -> /usr/local/lib/node_modules/babel-cli/bin/babel.js
114
+ /usr/local/bin/babel-external-helpers -> /usr/local/lib/node_modules/babel-cli/bin/babel-external-helpers.js
115
+
116
+ > fsevents@1.2.9 install /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
117
+ > node install
118
+
119
+ node-pre-gyp WARN Using needle for node-pre-gyp https download
120
+ 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)
121
+ node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/lib'
122
+ gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/north/Library/Caches/node-gyp/12.13.1"
123
+ gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/.node-gyp"
124
+ gyp WARN install got an error, rolling back install
125
+ gyp WARN install got an error, rolling back install
126
+ gyp ERR! configure error
127
+ gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/babel-cli/node_modules/fsevents/.node-gyp'
128
+ gyp ERR! System Darwin 17.7.0
129
+ 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"
130
+ gyp ERR! cwd /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
131
+ gyp ERR! node -v v12.13.1
132
+ gyp ERR! node-gyp -v v5.0.5
133
+ gyp ERR! not ok
134
+ node-pre-gyp ERR! build error
135
+ 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)
136
+ 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)
137
+ node-pre-gyp ERR! stack at ChildProcess.emit (events.js:210:5)
138
+ node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
139
+ node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
140
+ node-pre-gyp ERR! System Darwin 17.7.0
141
+ 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"
142
+ node-pre-gyp ERR! cwd /usr/local/lib/node_modules/babel-cli/node_modules/fsevents
143
+ node-pre-gyp ERR! node -v v12.13.1
144
+ node-pre-gyp ERR! node-pre-gyp -v v0.12.0
145
+ node-pre-gyp ERR! not ok
146
+ 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)
147
+
148
+ > core-js@2.6.10 postinstall /usr/local/lib/node_modules/babel-cli/node_modules/core-js
149
+ > node postinstall || echo "ignore"
150
+
151
+ Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
152
+
153
+ The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
154
+ > https://opencollective.com/core-js
155
+ > https://www.patreon.com/zloirock
156
+
157
+ Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
158
+
159
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/babel-cli/node_modules/fsevents):
160
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 install: `node install`
161
+ npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
162
+
163
+ + babel-cli@6.26.0
164
+ ```

4

試したことの内容の追記

2019/11/27 22:19

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -73,4 +73,25 @@
73
73
 
74
74
  インストール前から既にnode_modulesディレクトリが存在し、その中に古いBabelが存在していたためにBabel7が正常にインストールできなかったのかもと思い、node_modulesディレクトリの中のbabelと名がつくファイルやディレクトリ(babelifyディレクトリは除く)を全て削除し、再度Babel7をインストールするためのコマンドを実行しましたが、Babelのバージョンは6のまま変わっていませんでした。
75
75
 
76
+ 改めて`npm auditの結果`の結果です。
77
+
78
+ (npm auditの結果)
79
+ ```
80
+ ───────────────┬──────────────────────────────────────────────────────────────┐
81
+ │ Low │ Regular Expression Denial of Service │
82
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
83
+ │ Package │ braces │
84
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
85
+ │ Patched in │ >=2.3.1 │
86
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
87
+ │ Dependency of │ babel-cli │
88
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
89
+ │ Path │ babel-cli > chokidar > anymatch > micromatch > braces │
90
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
91
+ │ More info │ https://npmjs.com/advisories/786 │
92
+ └───────────────┴──────────────────────────────────────────────────────────────┘
93
+ ```
94
+
95
+ 今回も`npm audit fix`を実行してもBabelのバージョンは6のままで変わっていません。
96
+
76
97
  関係がないかもしれませんが、今は全てデスクトップ上でBrowserifyを動かそうとしていますが、それよりも早い時期に`/usr/local/lib/node_modules/`にBabelをインストールしていますが、それはBabel7をデスクトップにインストールする上で関係ないと思ってもいいでしょうか。

3

試したことの内容を追記

2019/11/18 05:47

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -46,4 +46,31 @@
46
46
  updated 3 packages and audited 6616 packages in 5.261s
47
47
  found 1 low severity vulnerability
48
48
  run `npm audit fix` to fix them, or `npm audit` for details
49
- ```
49
+ ```
50
+
51
+ ##(追記2:)
52
+ デスクトップにBabel7をインストールしようとしたのでデスクトップ上にBabelが作成されると思っていたためインストールに失敗したと思いましたが、デスクトップ上のnode_modulesディレクトリ内に作成されたのかもしれないと思い当たりました。
53
+ しかし、`babel --version`でBabelバージョンを確認すると`6.26.0 (babel-core 6.26.3)`なのでバージョンは変わっていませんでした。
54
+ 次に`npm audit`を実行しました。
55
+
56
+ (npm auditの結果)
57
+ ```
58
+ Low │ Regular Expression Denial of Service │
59
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
60
+ │ Package │ braces │
61
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
62
+ │ Patched in │ >=2.3.1 │
63
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
64
+ │ Dependency of │ babel-cli │
65
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
66
+ │ Path │ babel-cli > chokidar > anymatch > micromatch > braces │
67
+ ├───────────────┼──────────────────────────────────────────────────────────────┤
68
+ │ More info │ https://npmjs.com/advisories/786
69
+ ```
70
+
71
+ `npm audit fix`を実行してもBabelのバージョンは6のままでした。
72
+
73
+
74
+ インストール前から既にnode_modulesディレクトリが存在し、その中に古いBabelが存在していたためにBabel7が正常にインストールできなかったのかもと思い、node_modulesディレクトリの中のbabelと名がつくファイルやディレクトリ(babelifyディレクトリは除く)を全て削除し、再度Babel7をインストールするためのコマンドを実行しましたが、Babelのバージョンは6のまま変わっていませんでした。
75
+
76
+ 関係がないかもしれませんが、今は全てデスクトップ上でBrowserifyを動かそうとしていますが、それよりも早い時期に`/usr/local/lib/node_modules/`にBabelをインストールしていますが、それはBabel7をデスクトップにインストールする上で関係ないと思ってもいいでしょうか。

2

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

2019/11/18 05:45

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -26,4 +26,24 @@
26
26
  at Module.load (internal/modules/cjs/loader.js:653:32)
27
27
  at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
28
28
  at Function.Module._load (internal/modules/cjs/loader.js:585:3)
29
+ ```
30
+
31
+ ##(追記:)
32
+ ###Babel7をインストールするために行なったコマンド(→インストール不可))
33
+ ```
34
+ npm install --save-dev @babel/core @babel/cli @babel/preset-env
35
+ ```
36
+ [インストールのための参考サイト](https://chaika.hatenablog.com/entry/2018/11/21/150000)
37
+
38
+ ###エラーメッセージ
39
+ ```
40
+ npm WARN desktop@1.0.0 No description
41
+ npm WARN desktop@1.0.0 No repository field.
42
+
43
+ + @babel/cli@7.7.0
44
+ + @babel/core@7.7.2
45
+ + @babel/preset-env@7.7.1
46
+ updated 3 packages and audited 6616 packages in 5.261s
47
+ found 1 low severity vulnerability
48
+ run `npm audit fix` to fix them, or `npm audit` for details
29
49
  ```

1

エラーメッセージ追記

2019/11/14 20:29

投稿

theplace
theplace

スコア24

title CHANGED
File without changes
body CHANGED
@@ -6,4 +6,24 @@
6
6
 
7
7
  これは何が原因なのでしょうか。
8
8
 
9
- 最初、デスクトップにpackage.jsonがなかったので`npm init`でpackage.jsonを作りましたが、特に関係がなかったようです。
9
+ 最初、デスクトップにpackage.jsonがなかったので`npm init`でpackage.jsonを作りましたが、特に関係がなかったようです。
10
+
11
+ (エラーメッセージ)
12
+ ```
13
+ /Users/north/Desktop/node_modules/babelify/index.js:16
14
+ throw err;
15
+ ^
16
+
17
+ Error: Cannot find module '@babel/core'
18
+ 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'.
19
+ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
20
+ at Function.Module._load (internal/modules/cjs/loader.js:562:25)
21
+ at Module.require (internal/modules/cjs/loader.js:692:17)
22
+ at require (internal/modules/cjs/helpers.js:25:18)
23
+ at Object.<anonymous> (/Users/north/Desktop/node_modules/babelify/index.js:9:11)
24
+ at Module._compile (internal/modules/cjs/loader.js:778:30)
25
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
26
+ at Module.load (internal/modules/cjs/loader.js:653:32)
27
+ at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
28
+ at Function.Module._load (internal/modules/cjs/loader.js:585:3)
29
+ ```