zoukankan      html  css  js  c++  java
  • Module not found: Error: Can't resolve 'bundle.js' in...

    $ npm run build
    
    > simple-app-demo@1.0.0 build D:workgitsimple-app-demo
    > webpack app.js bundle.js
    
    Hash: af174d80108e932cdc49
    Version: webpack 4.29.3
    Time: 319ms
    Built at: 2019-02-15 10:52:12
     1 asset
    Entrypoint main = main.js
    [0] multi ./app.js bundle.js 40 bytes {0} [built]
    [1] ./app.js 60 bytes {0} [built]
        + 1 hidden module
    
    WARNING in configuration
    The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'p    roduction' to enable defaults for each environment.
    You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/
    
    ERROR in multi ./app.js bundle.js
    Module not found: Error: Can't resolve 'bundle.js' in 'D:workgitsimple-app-demo'
     @ multi ./app.js bundle.js main[1]
    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! simple-app-demo@1.0.0 build: `webpack app.js bundle.js`
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the simple-app-demo@1.0.0 build script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     D:Users\AppDataRoaming
    pm-cache\_logs2019-02-15T02_52_12_529Z-debug.log

    执行webpack打包的时候报错如上,解决方法:

    把package.json里面的scripts命令修改为:

    "build": "webpack app.js -o bundle.js",
  • 相关阅读:
    node + express 搭建服务器,修改为自动重启服务器
    在sublime上运行node
    node + express本地搭建服务器,开启一个新的项目
    关于数据库的一些基本操作语句
    8.数据库编程
    2.关于偏函数
    7.多线程编程
    1.关于__call__的很有意思的用法
    6.python中的网络编程
    4.python中常用的魔法方法(长期更新)
  • 原文地址:https://www.cnblogs.com/fe-cherrydlh/p/10382444.html
Copyright © 2011-2022 走看看