外していたらすみません。
ひょっとして、rootで実行したら解決する、と言う話ではないでしょうか。
Bash
1 誤)
2 $ npm install -g expo-cli
3
4 正)
5 $ sudo npm install -g expo-cli
追記:
手元で試してみました。
Plain
1 $ npm i expo-cli
2
3 > node-pty-prebuilt@0.7.6 install /Users/kazto/Documents/node_modules/node-pty-prebuilt
4 > prebuild-install || node scripts/install.js
5
6 prebuild-install WARN install No prebuilt binaries found (target=11.6.0 runtime=node arch=x64 libc= platform=darwin)
7 gyp ERR! configure error
8 gyp ERR! stack Error: Command failed: /Users/kazto/.pyenv/shims/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
9 gyp ERR! stack File "<string>", line 1
10 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
11 gyp ERR! stack ^
12 gyp ERR! stack SyntaxError: invalid syntax
13 gyp ERR! stack
14 gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
15 gyp ERR! stack at ChildProcess.emit (events.js:188:13)
16 gyp ERR! stack at maybeClose (internal/child_process.js:978:16)
17 gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:395:11)
18 gyp ERR! stack at Socket.emit (events.js:188:13)
19 gyp ERR! stack at Pipe._handle.close (net.js:610:12)
20 gyp ERR! System Darwin 18.2.0
21 gyp ERR! command "/usr/local/Cellar/node/11.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--build_v8_with_gn=false"
22 gyp ERR! cwd /Users/kazto/Documents/node_modules/node-pty-prebuilt
23 gyp ERR! node -v v11.6.0
24 gyp ERR! node-gyp -v v3.8.0
25 gyp ERR! not ok
26 npm WARN saveError ENOENT: no such file or directory, open '/Users/kazto/Documents/package.json'
27 npm WARN enoent ENOENT: no such file or directory, open '/Users/kazto/Documents/package.json'
28 npm WARN gatsby-source-filesystem@2.0.3 requires a peer of gatsby@>2.0.0-alpha but none is installed. You must install peer dependencies yourself.
29 npm WARN gatsby-transformer-yaml@2.1.3 requires a peer of gatsby@>2.0.15 but none is installed. You must install peer dependencies yourself.
30 npm WARN Documents No description
31 npm WARN Documents No repository field.
32 npm WARN Documents No README data
33 npm WARN Documents No license field.
34 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-darwin-ia32@2.2.8 (node_modules/@expo/ngrok-bin-darwin-ia32):
35 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-darwin-ia32@2.2.8: wanted {"os":"darwin","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
36 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-freebsd-ia32@2.2.8 (node_modules/@expo/ngrok-bin-freebsd-ia32):
37 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-freebsd-ia32@2.2.8: wanted {"os":"freebsd","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
38 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-linux-arm64@2.2.8 (node_modules/@expo/ngrok-bin-linux-arm64):
39 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-linux-arm64@2.2.8: wanted {"os":"linux","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
40 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-linux-ia32@2.2.8 (node_modules/@expo/ngrok-bin-linux-ia32):
41 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-linux-ia32@2.2.8: wanted {"os":"linux","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
42 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-linux-arm@2.2.8 (node_modules/@expo/ngrok-bin-linux-arm):
43 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-linux-arm@2.2.8: wanted {"os":"linux","arch":"arm"} (current: {"os":"darwin","arch":"x64"})
44 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-freebsd-x64@2.2.8 (node_modules/@expo/ngrok-bin-freebsd-x64):
45 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-freebsd-x64@2.2.8: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
46 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-sunos-x64@2.2.8 (node_modules/@expo/ngrok-bin-sunos-x64):
47 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-sunos-x64@2.2.8: wanted {"os":"sunos","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
48 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-win32-x64@2.2.8-beta.1 (node_modules/@expo/ngrok-bin-win32-x64):
49 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-win32-x64@2.2.8-beta.1: wanted {"os":"win32","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
50 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-win32-ia32@2.2.8-beta.1 (node_modules/@expo/ngrok-bin-win32-ia32):
51 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-win32-ia32@2.2.8-beta.1: wanted {"os":"win32","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
52 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-linux-x64@2.2.8 (node_modules/@expo/ngrok-bin-linux-x64):
53 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-linux-x64@2.2.8: wanted {"os":"linux","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
54 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/traveling-fastlane-linux@1.8.0 (node_modules/@expo/traveling-fastlane-linux):
55 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/traveling-fastlane-linux@1.8.0: wanted {"os":"win32,linux","arch":"any"} (current: {"os":"darwin","arch":"x64"})
56 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-pty-prebuilt@0.7.6 (node_modules/node-pty-prebuilt):
57 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-pty-prebuilt@0.7.6 install: `prebuild-install || node scripts/install.js`
58 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
59
60 + expo-cli@2.11.6
61 updated 1 package and audited 14838 packages in 17.071s
62 found 10 vulnerabilities (5 low, 5 moderate)
63 run `npm audit fix` to fix them, or `npm audit` for details
私の環境では、これだけの量のログが出ています。
質問者様には、再度お願いいたしますが、ログを全文貼り付けるよう、お願いします。
「npm ERR! code MODULE_NOT_FOUND」で検索したところ、下記に当たりました。
https://github.com/tj/n/issues/453
一度、node_modulesフォルダを全削除してNode.jsをインストールしなおすと上手くいく、とのことです。
Bash
1 $ sudo rm -rf /usr/local/lib/node_modules
2 $ curl -0 -L https://npmjs.com/install.sh | sudo sh