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 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)