baidu_27785259 2019-04-26 10:43 采纳率: 100%
浏览 6408
已采纳

npm run build 时出错

https://github.com/greggman/webgl-fundamentals

在git下载了这个项目,想要在本地运行,结果在执行 npm run build 时出错。请大佬帮忙看一下。

控制台:

Running "buildlessons" task
Warning: requires at least node: 11 Use --force to continue.

Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! webgl-fundamentals@0.0.0 build: `grunt`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the webgl-fundamentals@0.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!     C:\Users\56386\AppData\Roaming\npm-cache\_logs\2019-04-26T02_09_33_735Z-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   'build' ]
2 info using npm@6.4.1
3 info using node@v10.15.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle webgl-fundamentals@0.0.0~prebuild: webgl-fundamentals@0.0.0
6 info lifecycle webgl-fundamentals@0.0.0~build: webgl-fundamentals@0.0.0
7 verbose lifecycle webgl-fundamentals@0.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle webgl-fundamentals@0.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\WorkLibo\webgl-fundamentals\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;C:\Users\56386\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\56386\AppData\Local\Microsoft\WindowsApps;;C:\Fiddler;C:\Users\56386\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\WebStorm 2019.1\bin;;C:\Users\56386\AppData\Roaming\npm
9 verbose lifecycle webgl-fundamentals@0.0.0~build: CWD: C:\WorkLibo\webgl-fundamentals
10 silly lifecycle webgl-fundamentals@0.0.0~build: Args: [ '/d /s /c', 'grunt' ]
11 silly lifecycle webgl-fundamentals@0.0.0~build: Returned: code: 3  signal: null
12 info lifecycle webgl-fundamentals@0.0.0~build: Failed to exec build script
13 verbose stack Error: webgl-fundamentals@0.0.0 build: `grunt`
13 verbose stack Exit status 3
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid webgl-fundamentals@0.0.0
15 verbose cwd C:\WorkLibo\webgl-fundamentals
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v10.15.3
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 3
22 error webgl-fundamentals@0.0.0 build: `grunt`
22 error Exit status 3
23 error Failed at the webgl-fundamentals@0.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3, true ]


  • 写回答

2条回答 默认 最新

  • 铸仙 2019-04-28 11:13
    关注

    Running "buildlessons" task
    Warning: requires at least node: 11 Use --force to continue.

    这个文件提示node 版本至少要11,升级node 再来编译

    大致的编译顺序 npm build
    脚本运行时执行package.json,执行里面的scripts 的build, 执行grunt。 grunt 会找 Gruntfile.js 执行.

    webgl-fundamentals\build\js\build.js 中限制版本要>11.

    const requiredNodeVersion = 11;
    if (parseInt((/^v(\d+)./).exec(process.version)[1]) < requiredNodeVersion) {
    throw Error(requires at least node: ${requiredNodeVersion});
    }

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置