npm list 指令之後拋出錯誤
npm ERR! extraneous: babel-generator /Users/zach/node_modules/babel-generator
npm ERR! error in /Users/zach/node_modules/babel-generator: ENOENT: no such file or directory, open '/Users/zach/node_modules/babel-generator/package.json'
npm ERR! extraneous: babel-template /Users/zach/node_modules/babel-template
npm ERR! error in /Users/zach/node_modules/babel-template: ENOENT: no such file or directory, open '/Users/zach/node_modules/babel-template/package.json'
npm ERR! extraneous: babel-traverse /Users/zach/node_modules/babel-traverse
npm ERR! error in /Users/zach/node_modules/babel-traverse: ENOENT: no such file or directory, open '/Users/zach/node_modules/babel-traverse/package.json'
npm ERR! extraneous: caching-transform /Users/zach/node_modules/caching-transform
npm ERR! error in /Users/zach/node_modules/caching-transform: ENOENT: no such file or directory, open '/Users/zach/node_modules/caching-transform/package.json'
先確認 npm 版本 我記得有一個版本的 npm 有 bug,升級到你這個大版本的最高版本。
然後
rm -rf node_modules/
npm cache clean