我在用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:其中的路径是我省略有点长的路径作的简写(不是中文路径)。
另外,如果我不勾选这两个babel
和eslint
选项就好像可以成功建立
排除了好几个小时了,都没有找到问题所在,npm都换了好几个版本,我怀疑是兼容性问题?
node版本
:V8.11.4
npm版本
:5.6.0
这样尝试一下:
别用中文
npm install
之前先把项目目录下的node_modules
目录给删除再执行