首页   注册   登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
TomVista
V2EX  ›  Vue.js

vuecli 出错,找不到问题,帮忙看一下

  •  
  •   TomVista · 6 天前 · 584 次点击

    错误和日志

    build 出来的东西有几个 js error

    PS C:\Users\tomvi\Desktop\app> npm run mp
    
    > [email protected] mp C:\Users\tomvi\Desktop\app
    > cross-env MP_ENV=miniprogram vue-cli-service build --mode development --dest ./dist/mp/common --watch
    
    vue.config
    
    /  Building for development...
    dependencies has been built
    
     ERROR  Build failed with errors.
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] mp: `cross-env MP_ENV=miniprogram vue-cli-service build --mode development --dest ./dist/mp/common --watch`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] mp 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!     C:\Users\tomvi\AppData\Roaming\npm-cache\_logs\2020-06-30T03_29_00_880Z-debug.log   
    PS C:\Users\tomvi\Desktop\app>
    

    C:\Users\tomvi\AppData\Roaming\npm-cache_logs\2020-06-30T03_29_00_880Z-debug.log

    0 info it worked if it ends with ok
    1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
    1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
    1 verbose cli   'run',
    1 verbose cli   'mp' ]
    2 info using [email protected]
    3 info using [email protected]
    4 verbose run-script [ 'premp', 'mp', 'postmp' ]
    5 info lifecycle [email protected]~premp: [email protected]
    6 info lifecycle [email protected]~mp: [email protected]
    7 verbose lifecycle [email protected]~mp: unsafe-perm in lifecycle true
    8 verbose lifecycle [email protected]~mp: PATH: C:\Users\tomvi\AppData\Roaming\nvm\v10.16.3\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\tomvi\Desktop\app\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;%NVM_HOME%;%NVM_SYMLINK%;C:\Program Files\Git\cmd;C:\Users\tomvi\AppData\Local\Microsoft\WindowsApps;C:\Users\tomvi\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\tomvi\AppData\Roaming\nvm;C:\Program Files\nodejs
    9 verbose lifecycle [email protected]~mp: CWD: C:\Users\tomvi\Desktop\app
    10 silly lifecycle [email protected]~mp: Args: [ '/d /s /c',
    10 silly lifecycle   'cross-env MP_ENV=miniprogram vue-cli-service build --mode development --dest ./dist/mp/common --watch' ]
    11 silly lifecycle [email protected]~mp: Returned: code: 1  signal: null
    12 info lifecycle [email protected]~mp: Failed to exec mp script
    13 verbose stack Error: [email protected] mp: `cross-env MP_ENV=miniprogram vue-cli-service build --mode development --dest ./dist/mp/common --watch`
    13 verbose stack Exit status 1
    13 verbose stack     at EventEmitter.<anonymous> (C:\Users\tomvi\AppData\Roaming\nvm\v10.16.3\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
    13 verbose stack     at EventEmitter.emit (events.js:198:13)
    13 verbose stack     at ChildProcess.<anonymous> (C:\Users\tomvi\AppData\Roaming\nvm\v10.16.3\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
    13 verbose stack     at ChildProcess.emit (events.js:198:13)
    13 verbose stack     at maybeClose (internal/child_process.js:982:16)
    13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
    14 verbose pkgid [email protected]
    15 verbose cwd C:\Users\tomvi\Desktop\app
    16 verbose Windows_NT 10.0.18362
    17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "mp"
    18 verbose node v10.16.3
    19 verbose npm  v6.9.0
    20 error code ELIFECYCLE
    21 error errno 1
    22 error [email protected] mp: `cross-env MP_ENV=miniprogram vue-cli-service build --mode development --dest ./dist/mp/common --watch`
    22 error Exit status 1
    23 error Failed at the [email protected] mp script.
    23 error This is probably not a problem with npm. There is likely additional logging output above.
    24 verbose exit [ 1, true ]
    
    
    第 1 条附言  ·  6 天前
    不用 vue/cli,用框架给的 webpack 配置,避免了这个问题
    5 条回复    2020-07-02 10:27:03 +08:00
    onfuns
        1
    onfuns   6 天前
    权限不够,右键命令行工具管理员运行。
    TomVista
        2
    TomVista   6 天前
    @onfuns 即使使用管理员权限,也会出现这个情况, 甚至有时候,再次执行这个命令,能 buid 过,:dog
    maojy1989
        3
    maojy1989   6 天前
    用 npm cache clean --force 清除缓存然后删除 node_modules 跟 package-lock.json 再重新安装试试
    96412hj
        4
    96412hj   4 天前
    你是不是吧 package.lock.json 删了
    TomVista
        5
    TomVista   4 天前
    @96412hj 没有,我尝试了删除 package.lock.json, 重新 npm i,不行,还是这个样子
    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   1818 人在线   最高记录 5168   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 112ms · UTC 16:54 · PVG 00:54 · LAX 09:54 · JFK 12:54
    ♥ Do have faith in what you're doing.