gpt4 book ai didi

javascript - 如何修复安装 Open MCT 时出现的解析错误?

转载 作者:行者123 更新时间:2023-11-30 13:54:56 24 4
gpt4 key购买 nike

我目前正在尝试安装 NASA 的 Open MCT ( Link ),但在安装过程中已经遇到错误。运行 npm install 后,我收到以下错误消息:

{ Error: Parse error using esprima for file: C:/Users/MCTUser/openmct/node_modules/painterro/build/painterro.min.js
Error: Line 258: Unexpected token *
at C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:29563:47
at C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3063:37
at C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3011:25
at Function.prim.nextTick (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:29929:9)
at Object.callback (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3010:26)
at Object.then (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3060:23)
at C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:29548:36
at C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3063:37
at C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3011:25
at Function.prim.nextTick (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:29929:9)
fileName:
'C:/Users/MCTUser/openmct/node_modules/painterro/build/painterro.min.js' }

events.js:174
throw er; // Unhandled 'error' event
^
Error: Error: Module loading did not complete for: openmct, src/MCT, src/plugins/plugins, platform/features/notebook/bundle, platform/features/notebook/src/actions/AnnotateSnapshot, painterro
at Function.build.checkForErrors (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:31556:19)

at C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:30099:19
at C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3081:39
at C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3021:25
at Function.prim.nextTick (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:29929:9)
at Object.errback (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3020:26)
at Object.callback (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3006:23)
at Object.then (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:3060:23)
at build (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:30056:12)
at runBuild (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:32006:17)
at Object.execCb (C:\Users\MCTUser\openmct\node_modules\requirejs\bin\r.js:1941:33)
Emitted 'error' event at:
at DestroyableTransform.onerror (C:\Users\MCTUser\openmct\node_modules\readable-stream\lib\_stream_readable.js:640:52)
at DestroyableTransform.emit (events.js:198:13)
at done (C:\Users\MCTUser\openmct\node_modules\readable-stream\lib\_stream_transform.js:202:25)
at C:\Users\MCTUser\openmct\node_modules\readable-stream\lib\_stream_transform.js:139:7
at DestroyableTransform._flush (C:\Users\MCTUser\openmct\node_modules\gulp-requirejs-optimize\index.js:97:4)
at DestroyableTransform.prefinish (C:\Users\MCTUser\openmct\node_modules\readable-stream\lib\_stream_transform.js:138:10)
at DestroyableTransform.emit (events.js:198:13)
at prefinish (C:\Users\MCTUser\openmct\node_modules\readable-stream\lib\_stream_writable.js:619:14)
at finishMaybe (C:\Users\MCTUser\openmct\node_modules\readable-stream\lib\_stream_writable.js:627:5)
at endWritable (C:\Users\MCTUser\openmct\node_modules\readable-stream\lib\_stream_writable.js:638:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! openmct@0.14.0-SNAPSHOT prepare: `node ./node_modules/bower/bin/bower install && node ./node_modules/gulp/bin/gulp.js install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the openmct@0.14.0-SNAPSHOT prepare 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\MCTUser\AppData\Roaming\npm-cache\_logs\2019-08-14T12_42_14_925Z-debug.log

我按照教程中的要求安装了 GIT 和 Node.js。有谁知道可能是什么原因以及如何解决?

最佳答案

  1. 安装 npm-check-updates(ncu)

  2. 使用ncu更新所有模块,查看ncu帮助,更新package.json

  3. 运行“npm install”更新模块

  4. 重新安装 gulp ver3.x.x,因为 gulpfile.js 以旧方式编写

  5. 将文件 opencmt.js 中的 d3-* 路径“build”修改为“dist”然后它运行 npm install ,它会好的

关于javascript - 如何修复安装 Open MCT 时出现的解析错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57495208/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com