Webpack: Running npm run unit throws errors : module component-normalizer not found.

Created on 27 Jan 2017  路  3Comments  路  Source: vuejs-templates/webpack

Setting up vue project out of the box and running unit tests throws this error

`
c:\projects\vue-scratch\newproj>npm run unit

[email protected] unit c:\projects\vue-scratch\newproj
cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run

Hash: 920f5d09f2c448acc19e
Version: webpack 1.14.0
Time: 2752ms
Asset Size Chunks Chunk Names
index.js 700 kB 0 [emitted] index.js
chunk {0} index.js (index.js) 259 kB [rendered]
[0] ./test/unit/index.js 286 bytes {0} [built]
[1] ./~/function-bind/index.js 111 bytes {0} [built]
[2] ./~/function-bind/implementation.js 1.42 kB {0} [built]
[3] ./test/unit/specs .spec$ 177 bytes {0} [built]
[4] ./test/unit/specs/Hello.spec.js 633 bytes {0} [optional] [built]
[5] ./~/vue/dist/vue.common.js 226 kB {0} [built]
[6] ./src/components/Hello.vue 1.54 kB {0} [built] [1 error]
[7] ./~/vue-style-loader!./~/css-loader!./~/vue-loader/lib/style-rewriter.js
?id=data-v-7f6b5737&scoped=true!./~/vue-loader/lib/selector.js?type=styles&index
=0!./src/components/Hello.vue 1.38 kB {0} [built]
[8] ./~/css-loader!./~/vue-loader/lib/style-rewriter.js?id=data-v-7f6b5737&s
coped=true!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/components/H
ello.vue 414 bytes {0} [built]
[9] ./~/css-loader/lib/css-base.js 1.51 kB {0} [built]
[10] ./~/vue-style-loader/addStyles.js 6.24 kB {0} [built]
[11] ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!
./src/components/Hello.vue 2.71 kB {0} [built]
[12] ./~/vue-loader/lib/template-compiler.js?id=data-v-7f6b5737!./~/vue-loade
r/lib/selector.js?type=template&index=0!./src/components/Hello.vue 2.13 kB {0} [
built]
[13] ./src ^.\/(?!main(.js)?$) 256 bytes {0} [built]
[14] ./src/App.vue 1.48 kB {0} [optional] [built] [1 error]
[15] ./~/vue-style-loader!./~/css-loader!./~/vue-loader/lib/style-rewriter.js
?id=data-v-e88951f4!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App
.vue 1.31 kB {0} [built]
[16] ./~/css-loader!./~/vue-loader/lib/style-rewriter.js?id=data-v-e88951f4!.
/~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 367 bytes {0} [b
uilt]
[17] ./~/babel-loader/lib!./~/vue-loader/lib/selector.js?type=script&index=0!
./src/App.vue 1.71 kB {0} [built]
[18] ./~/vue-loader/lib/template-compiler.js?id=data-v-e88951f4!./~/vue-loade
r/lib/selector.js?type=template&index=0!./src/App.vue 487 bytes {0} [built]
[19] ./src/assets/logo.png 9.17 kB {0} [built]

ERROR in ./src/components/Hello.vue
Module not found: Error: Cannot resolve module 'c:projects鈾倁e-scratch
ewproj
ode_modules鈾倁e-loaderlibcomponent-normalizer' in c:\projects\vue-scratch\newproj
src\components
@ ./src/components/Hello.vue 5:16-107

ERROR in ./src/App.vue
Module not found: Error: Cannot resolve module 'c:projects鈾倁e-scratch
ewproj
ode_modules鈾倁e-loaderlibcomponent-normalizer' in c:\projects\vue-scratch\newproj
src
@ ./src/App.vue 5:16-107
27 01 2017 12:43:57.930:INFO [karma]: Karma v1.4.0 server started at http://0.0.
0.0:9876/
27 01 2017 12:43:57.933:INFO [launcher]: Launching browser PhantomJS with unlimi
ted concurrency
27 01 2017 12:43:57.981:INFO [launcher]: Starting browser PhantomJS
27 01 2017 12:43:59.931:INFO [PhantomJS 2.1.1 (Windows 7 0.0.0)]: Connected on s
ocket IjFWEeq4gJ04RSUdAAAA with id 30404141
PhantomJS 2.1.1 (Windows 7 0.0.0) INFO LOG: 'You are running Vue in development
mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html'
PhantomJS 2.1.1 (Windows 7 0.0.0) ERROR
Error: Cannot find module "c:projects鈾倁e-scratch
ewproj
ode_modules鈾倁e-loaderlibcomponent-normalizer"
at webpack:///src/components/Hello.vue:5:0 <- index.js:8752

PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 0 of 0 ERROR (0.14 secs / 0 secs)

PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 0 of 0 ERROR (0 secs / 0 secs)

=============================== Coverage summary ===============================

Statements : 100% ( 0/0 )
Branches : 100% ( 0/0 )
Functions : 100% ( 0/0 )

Lines : 100% ( 0/0 )

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "run" "unit"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] unit: cross-env BABEL_ENV=test karma start test/unit/kar ma.conf.js --single-run
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] unit script 'cross-env BABEL_ENV=test karma
start test/unit/karma.conf.js --single-run'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the scratch package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --sing
le-run
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs scratch
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls scratch
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! c:\projects\vue-scratch\newproj\npm-debug.log

c:\projects\vue-scratch\newproj>`

Most helpful comment

vue-loader 10.1.2 should fix this, please upgrade.

All 3 comments

I ran into the same problem after running a fresh npm install.

Seems like it has something to do with vue-loader. I tried reinstalling an older vesion via npm install [email protected] --save-dev, which seems to work. Hopefully this can get fixed soon.

Same problem here.

@dcdrawk your fix worked.

vue-loader 10.1.2 should fix this, please upgrade.

Was this page helpful?
0 / 5 - 0 ratings