rohitkrai03 / vue-starter

A Vue.js starter kit that lets you focus on more programming and less configuration.
http://arkpod.in/vue-starter
MIT License
54 stars 11 forks source link

'npm install' not installing dependency #4

Open masonoise opened 6 years ago

masonoise commented 6 years ago

Just a quick note that after following the docs to do "vue-init", then "npm install", running "npm run dev" had an error:

 ERROR  Failed to compile with 1 errors                                                                       6:16:37 PM

This dependency was not found:

* element-ui/lib/theme-chalk/index.css in ./src/js/main.js

To install it, you can run: npm install --save element-ui/lib/theme-chalk/index.css

...and...

ERROR in ./src/js/main.js

  ✘  https://google.com/#q=import%2Fno-unresolved  Unable to resolve path to module 'element-ui/lib/theme-chalk/index.css'
  src/js/main.js:4:8
  import 'element-ui/lib/theme-chalk/index.css';
          ^

✘ 1 problem (1 error, 0 warnings)

Errors:
  1  https://google.com/#q=import%2Fno-unresolved
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/js/main.js

ERROR in ./src/js/main.js
Module not found: Error: Can't resolve 'element-ui/lib/theme-chalk/index.css' in '/Users/mason/workspace/creator-hub/src/js'
 @ ./src/js/main.js 4:0-46
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/js/main.js
Child html-webpack-plugin for "index.html":
     1 asset
       [0] ./node_modules/html-webpack-plugin/lib/loader.js!./index.html 667 bytes {0} [built]
       [1] ./node_modules/lodash/lodash.js 540 kB {0} [built]
       [2] (webpack)/buildin/global.js 488 bytes {0} [built]
       [3] (webpack)/buildin/module.js 495 bytes {0} [built]

Just to keep moving along I tried doing the npm install of that css, but it reports:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "element-ui/lib/theme-chalk/index.css" as it does not contain a package.json file.

I'll comment again if I have a chance to dig in and see what's up, but I wanted to let you know. Thanks.

masonoise commented 6 years ago

Got it, I changed the element-ui spec in package.json to "^2.0.4" and it seems to be working. Looks like there was an issue in an earlier 1.x that got pulled in? Not sure really, as I don't know anything about Element (yet), but it did compile and load; so far, so good. Thanks!

rohitkrai03 commented 6 years ago

I have fixed the issue now and its working. Please check PR

masonoise commented 6 years ago

Thanks! Interesting though, after updating to use "^2.0.4" it works with chalk, but not with the default that's in your PR. I'll look into it a bit more.