vue-cli@3.0 create 创建新项目的时候出现问题,可能关于babel与ESLint

我在用vue-cli命令sudo vue create hello-world创建新项目的时候,只要勾选了配置中的
babel或者eslint选项就会出现下列的错误。

[fsevents] Success: "/Users/tanghaoyi/路径/work/VueSingle/hello-world/node_modules/@vue/cli-plugin-babel/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v59-darwin-x64/fse.node" is installed via remote
npm ERR! Darwin 16.7.0
npm ERR! argv "/Users/tanghaoyi/node_modules/node/bin/node" "/Users/tanghaoyi/node_modules/.bin/npm" "install" "--loglevel" "error"
npm ERR! node v9.0.0
npm ERR! npm  v2.15.12
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package @babel/core@7.0.0-beta.47 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer babel-loader@8.0.4 wants @babel/core@^7.0.0

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tanghaoyi/路径/VueSingle/hello-world/npm-debug.log
 ERROR  command failed: npm install --loglevel error

PS:其中的路径是我省略有点长的路径作的简写(不是中文路径)。
另外,如果我不勾选这两个babeleslint选项就好像可以成功建立

排除了好几个小时了,都没有找到问题所在,npm都换了好几个版本,我怀疑是兼容性问题?

node版本:V8.11.4
npm版本:5.6.0

阅读 4.7k
2 个回答

这样尝试一下:

  1. 路径中别用中文
  2. 执行npm install之前先把项目目录下的node_modules目录给删除再执行

写的很明白啊,对等依赖不满足
尝试修改package.json的 @babel/core@7.0.0-beta.47 => @babel/core@^7.0.0

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题