Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Webpack 未找到模块(网页包&x2B;vue)_Webpack_Vuejs2 - Fatal编程技术网

Webpack 未找到模块(网页包&x2B;vue)

Webpack 未找到模块(网页包&x2B;vue),webpack,vuejs2,Webpack,Vuejs2,使用webpack+vue构建项目,webpack包始终提示错误,请参阅代码 G:\test\webpack_vue>webpack Hash: 3a2915ed9e32c621ed2c Version: webpack 3.6.0 Time: 608ms Asset Size Chunks Chunk Names build.js 208 kB 0 [emitted] main [0] ./src/main.js 133 by

使用webpack+vue构建项目,webpack包始终提示错误,请参阅代码

G:\test\webpack_vue>webpack
Hash: 3a2915ed9e32c621ed2c
Version: webpack 3.6.0
Time: 608ms
   Asset    Size  Chunks             Chunk Names
build.js  208 kB       0  [emitted]  main
   [0] ./src/main.js 133 bytes {0} [built]
   [3] (webpack)/buildin/global.js 509 bytes {0} [built]
    + 2 hidden modules

ERROR in ./src/main.js
Module not found: Error: Can't resolve 'vue-loader' in 'G:\test\webpack_vue'
 @ ./src/main.js 4:0-28
G:\test\webpack_vue>npm install --save-dev babel-core babel-loader babel-plugin-
transform-runtime babel-preset-es2015 babel-runtime css-loader vue-hot-reload-ap
i vue-html-loader vue-style-loader vue-loader
npm WARN deprecated babel-preset-es2015@6.24.1: We're super �  excited that you'
re trying to use ES2015 syntax, but instead of making more yearly presets � , Ba
bel now has a better preset that we recommend you use instead: npm install babel
-preset-env --save-dev. preset-env without options will compile ES2015+ down to
ES5 just like using all the presets together and thus is more future proof. It a
lso allows you to target specific browsers so that Babel can do less work and yo
u can ship native ES2015+ to user � ! We are also in the process of releasing v7
, so please give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and h
elp test it out in beta! Thanks so much for using Babel �, please give us a foll
ow on Twitter @babeljs for news on Babel, join slack.babeljs.io for discussion/d
evelopment and help support the project at opencollective.com/babel
webpack_vue@1.0.0 G:\test\webpack_vue
+-- babel-core@6.26.0
+-- babel-loader@7.1.2
+-- babel-plugin-transform-runtime@6.23.0
+-- babel-preset-es2015@6.24.1
+-- babel-runtime@6.26.0
+-- css-loader@0.28.7
+-- vue-hot-reload-api@2.1.0
+-- vue-html-loader@1.2.4
`-- vue-style-loader@3.0.3

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm WARN webpack_vue@1.0.0 No description
npm WARN webpack_vue@1.0.0 No repository field.
npm WARN The package babel-core is included as both a dev and production depende
ncy.
npm WARN The package babel-loader is included as both a dev and production depen
dency.
npm ERR! path G:\test\webpack_vue\node_modules\js-beautify\js\bin\css-beautify.j
s
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'G:\test\webpack_vue\no
de_modules\js-beautify\js\bin\css-beautify.js'
npm ERR! enoent ENOENT: no such file or directory, chmod 'G:\test\webpack_vue\no
de_modules\js-beautify\js\bin\css-beautify.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\神盾局\AppData\Roaming\npm-cache\_logs\2017-09-18T09_54_48
_972Z-debug.log
所以我重新安装了所有的模块,结果还是提示有错误,详情要看代码

G:\test\webpack_vue>webpack
Hash: 3a2915ed9e32c621ed2c
Version: webpack 3.6.0
Time: 608ms
   Asset    Size  Chunks             Chunk Names
build.js  208 kB       0  [emitted]  main
   [0] ./src/main.js 133 bytes {0} [built]
   [3] (webpack)/buildin/global.js 509 bytes {0} [built]
    + 2 hidden modules

ERROR in ./src/main.js
Module not found: Error: Can't resolve 'vue-loader' in 'G:\test\webpack_vue'
 @ ./src/main.js 4:0-28
G:\test\webpack_vue>npm install --save-dev babel-core babel-loader babel-plugin-
transform-runtime babel-preset-es2015 babel-runtime css-loader vue-hot-reload-ap
i vue-html-loader vue-style-loader vue-loader
npm WARN deprecated babel-preset-es2015@6.24.1: We're super �  excited that you'
re trying to use ES2015 syntax, but instead of making more yearly presets � , Ba
bel now has a better preset that we recommend you use instead: npm install babel
-preset-env --save-dev. preset-env without options will compile ES2015+ down to
ES5 just like using all the presets together and thus is more future proof. It a
lso allows you to target specific browsers so that Babel can do less work and yo
u can ship native ES2015+ to user � ! We are also in the process of releasing v7
, so please give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and h
elp test it out in beta! Thanks so much for using Babel �, please give us a foll
ow on Twitter @babeljs for news on Babel, join slack.babeljs.io for discussion/d
evelopment and help support the project at opencollective.com/babel
webpack_vue@1.0.0 G:\test\webpack_vue
+-- babel-core@6.26.0
+-- babel-loader@7.1.2
+-- babel-plugin-transform-runtime@6.23.0
+-- babel-preset-es2015@6.24.1
+-- babel-runtime@6.26.0
+-- css-loader@0.28.7
+-- vue-hot-reload-api@2.1.0
+-- vue-html-loader@1.2.4
`-- vue-style-loader@3.0.3

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm WARN webpack_vue@1.0.0 No description
npm WARN webpack_vue@1.0.0 No repository field.
npm WARN The package babel-core is included as both a dev and production depende
ncy.
npm WARN The package babel-loader is included as both a dev and production depen
dency.
npm ERR! path G:\test\webpack_vue\node_modules\js-beautify\js\bin\css-beautify.j
s
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'G:\test\webpack_vue\no
de_modules\js-beautify\js\bin\css-beautify.js'
npm ERR! enoent ENOENT: no such file or directory, chmod 'G:\test\webpack_vue\no
de_modules\js-beautify\js\bin\css-beautify.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\神盾局\AppData\Roaming\npm-cache\_logs\2017-09-18T09_54_48
_972Z-debug.log

修补了两天,仍然没有效果,大人物帮帮忙,谢谢。

这是
beatify web/js beatify
依赖性的问题。看一看

作为临时解决方案,您可以使用以下依赖项“js美化”:“1.6.14”,方法是将其添加到
package.json
文件中