事象
npm install / uninstall 時に以下のエラーが発生します。
解決方法をお教えいただきたいです。
ターミナルログ
npm ERR! code MODULE_NOT_FOUND npm ERR! Cannot find module 'slash' npm ERR! Require stack: npm ERR! - /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js npm ERR! - /usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js npm ERR! - /usr/local/lib/node_modules/npm/lib/install.js npm ERR! - /usr/local/lib/node_modules/npm/lib/npm.js npm ERR! - /usr/local/lib/node_modules/npm/bin/npm-cli.js npm ERR! A complete log of this run can be found in: npm ERR! /Users/my_name/.npm/_logs/2020-03-22T01_48_45_735Z-debug.log
2020-03-22T01_48_45_735Z-debug.log
0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli '/usr/local/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'install', 1 verbose cli '-g', 1 verbose cli 'expo-cli' 1 verbose cli ] 2 info using npm@6.12.1 3 info using node@v12.13.1 4 verbose stack Error: Cannot find module 'slash' 4 verbose stack Require stack: 4 verbose stack - /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js 4 verbose stack - /usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js 4 verbose stack - /usr/local/lib/node_modules/npm/lib/install.js 4 verbose stack - /usr/local/lib/node_modules/npm/lib/npm.js 4 verbose stack - /usr/local/lib/node_modules/npm/bin/npm-cli.js 4 verbose stack at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15) 4 verbose stack at Function.Module._load (internal/modules/cjs/loader.js:690:27) 4 verbose stack at Module.require (internal/modules/cjs/loader.js:852:19) 4 verbose stack at require (internal/modules/cjs/helpers.js:74:18) 4 verbose stack at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:14:13) 4 verbose stack at Module._compile (internal/modules/cjs/loader.js:959:30) 4 verbose stack at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) 4 verbose stack at Module.load (internal/modules/cjs/loader.js:815:32) 4 verbose stack at Function.Module._load (internal/modules/cjs/loader.js:727:14) 4 verbose stack at Module.require (internal/modules/cjs/loader.js:852:19) 5 verbose cwd /Users/my_name/myActivity/study/react-native/expo/ISBN978 6 verbose Darwin 19.3.0 7 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "expo-cli" 8 verbose node v12.13.1 9 verbose npm v6.12.1 10 error code MODULE_NOT_FOUND 11 error Cannot find module 'slash' 11 error Require stack: 11 error - /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js 11 error - /usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js 11 error - /usr/local/lib/node_modules/npm/lib/install.js 11 error - /usr/local/lib/node_modules/npm/lib/npm.js 11 error - /usr/local/lib/node_modules/npm/bin/npm-cli.js 12 verbose exit [ 1, true ]
直前に実施したこと
npm install -g expo
ためしたこと
npm uninstall -g expo => 上記エラーが発生 npm install -g slash => 上記エラーが発生 npm install -g npm => 上記エラーが発生
環境
- macOS Catalina 10.15.3
- npm version 6.12.1
あなたの回答
tips
プレビュー