嗨博主你好,我正在学习你的项目.不过我在起步阶段遇到了一些小问题,在引入Element后就出现一堆错误,希望得到你的帮助,感谢.以下为我的详细操作
起步
Last login: Fri Jan 18 10:40:43 on ttys000
your-hostname:~ joey$ vue init webpack vue-llplatform
? Project name vue-llplatform
? Project description A Vue.js project
? Author illion [email protected]
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests Yes
? Pick a test runner jest
? Setup e2e tests with Nightwatch? Yes
? Should we run npm install
for you after the project has been created? (recom
mended) npm
vue-cli · Generated "vue-llplatform".
Installing project dependencies ...
========================
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: Switch to the bfj
package for fixes and new features!
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
[email protected] install /Users/joey/vue-llplatform/node_modules/fsevents
node install
node-pre-gyp WARN Using request for node-pre-gyp https download
[fsevents] Success: "/Users/joey/vue-llplatform/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote
[email protected] install /Users/joey/vue-llplatform/node_modules/chromedriver
node install.js
Current existing ChromeDriver binary is unavailable, proceding with download and extraction.
Downloading from file: https://chromedriver.storage.googleapis.com/2.45/chromedriver_mac64.zip
Saving to file: /var/folders/z9/m3t2s66n66d15c3f1rzy0kzw0000gn/T/chromedriver/chromedriver_mac64.zip
本地测试:
安装element:
错误信息
Last login: Fri Jan 18 11:14:15 on ttys000
your-hostname:~ joey$ npm i element-ui -s
- [email protected]
added 10 packages from 9 contributors and audited 11 packages in 8.698s
found 0 vulnerabilities
your-hostname:~ joey$ cd vue-llplatform
your-hostname:vue-llplatform joey$ npm run dev
[email protected] dev /Users/joey/vue-llplatform
webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
94% asset optimization -
ERROR Failed to compile with 1 errors 11:34:43 AM
error in ../node_modules/element-ui/lib/theme-chalk/index.css
Module build failed: Error: No PostCSS Config found in: /Users/joey/node_modules/element-ui/lib/theme-chalk
at config.load.then (/Users/joey/vue-llplatform/node_modules/postcss-load-config/src/index.js:55:15)
@ ../node_modules/element-ui/lib/theme-chalk/index.css 4:14-186 13:3-17:5 14:22-194
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
WAIT Compiling... 11:36:38 AM
95% emitting i
WARNING Compiled with 1 warnings 11:36:39 AM
✘ http://eslint.org/docs/rules/spaced-comment Expected space or tab after '//' in comment
src/main.js:6:35
import ElementUI from 'element-ui'//第一行
^
✘ http://eslint.org/docs/rules/spaced-comment Expected space or tab after '//' in comment
src/main.js:7:1
//import 'element-ui/lib/theme-chalk/index.css'//第二行
^
✘ http://eslint.org/docs/rules/spaced-comment Expected space or tab after '//' in comment
src/main.js:10:19
Vue.use(ElementUI)//第三行
^
✘ 3 problems (3 errors, 0 warnings)
Errors:
3 http://eslint.org/docs/rules/spaced-comment
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
下面这张图是再一次重头开始操作之后的报错信息..