我正在尝试安装并运行Open Mct。
他们在getting started page中要求: 1.克隆存储库“ git clone https://github.com/nasa/openmct.git” 2. npm安装 3. npm start
当我尝试“ npm install”时,出现一些错误。 我在2台不同的计算机上进行了尝试,但最终都出现了以下相同的错误:
PS C:\code\openmct> npm install
> openmct@1.0.0-snapshot prepare C:\code\openmct
> npm run build:prod
> openmct@1.0.0-snapshot build:prod C:\code\openmct
> cross-env NODE_ENV=production webpack
Hash: 77a6c86a519d4235aa9f
Version: webpack 4.41.5
Time: 14777ms
Built at: 02/10/2020 4:09:54 PM
11 assets
Entrypoint openmct = openmct.js openmct.js.map
Entrypoint espressoTheme = espressoTheme.js espressoTheme.js.map
Entrypoint snowTheme = snowTheme.js snowTheme.js.map
Entrypoint maelstromTheme = maelstromTheme.js maelstromTheme.js.map
ERROR in ./src/plugins/themes/espresso-theme.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/fast-sass-loader/lib/index.js):
Error: import file cannot be resolved: "@import "~styles/vendor/normalize-min";" @C:\code\openmct\src\plugins\themes\espresso-theme.scss
at Object.importReplacer (C:\code\openmct\node_modules\fast-sass-loader\lib\index.js:206:19)
at importReplacer.throw (<anonymous>)
at onRejected (C:\code\openmct\node_modules\co\index.js:81:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at C:\code\openmct\node_modules\webpack\lib\NormalModule.js:316:20
at C:\code\openmct\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at C:\code\openmct\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (C:\code\openmct\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at C:\code\openmct\node_modules\fast-sass-loader\lib\index.js:311:5
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
ERROR in ./src/plugins/themes/maelstrom-theme.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/fast-sass-loader/lib/index.js):
Error: import file cannot be resolved: "@import "~styles/vendor/normalize-min";" @C:\code\openmct\src\plugins\themes\maelstrom-theme.scss
at Object.importReplacer (C:\code\openmct\node_modules\fast-sass-loader\lib\index.js:206:19)
at importReplacer.throw (<anonymous>)
at onRejected (C:\code\openmct\node_modules\co\index.js:81:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at C:\code\openmct\node_modules\webpack\lib\NormalModule.js:316:20
at C:\code\openmct\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at C:\code\openmct\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (C:\code\openmct\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at C:\code\openmct\node_modules\fast-sass-loader\lib\index.js:311:5
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
ERROR in ./src/plugins/themes/snow-theme.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/fast-sass-loader/lib/index.js):
Error: import file cannot be resolved: "@import "~styles/vendor/normalize-min";" @C:\code\openmct\src\plugins\themes\snow-theme.scss
at Object.importReplacer (C:\code\openmct\node_modules\fast-sass-loader\lib\index.js:206:19)
at importReplacer.throw (<anonymous>)
at onRejected (C:\code\openmct\node_modules\co\index.js:81:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at C:\code\openmct\node_modules\webpack\lib\NormalModule.js:316:20
at C:\code\openmct\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at C:\code\openmct\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (C:\code\openmct\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at C:\code\openmct\node_modules\fast-sass-loader\lib\index.js:311:5
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/fast-sass-loader/lib/index.js!src/plugins/themes/espresso-theme.scss:
Entrypoint mini-css-extract-plugin = *
ERROR in ./src/plugins/themes/espresso-theme.scss (./node_modules/css-loader!./node_modules/fast-sass-loader/lib!./src/plugins/themes/espresso-theme.scss)
Module build failed (from ./node_modules/fast-sass-loader/lib/index.js):
Error: import file cannot be resolved: "@import "~styles/vendor/normalize-min";" @C:\code\openmct\src\plugins\themes\espresso-theme.scss
at Object.importReplacer (C:\code\openmct\node_modules\fast-sass-loader\lib\index.js:206:19)
at importReplacer.throw (<anonymous>)
at onRejected (C:\code\openmct\node_modules\co\index.js:81:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/fast-sass-loader/lib/index.js!src/plugins/themes/maelstrom-theme.scss:
Entrypoint mini-css-extract-plugin = *
ERROR in ./src/plugins/themes/maelstrom-theme.scss (./node_modules/css-loader!./node_modules/fast-sass-loader/lib!./src/plugins/themes/maelstrom-theme.scss)
Module build failed (from ./node_modules/fast-sass-loader/lib/index.js):
Error: import file cannot be resolved: "@import "~styles/vendor/normalize-min";" @C:\code\openmct\src\plugins\themes\maelstrom-theme.scss
at Object.importReplacer (C:\code\openmct\node_modules\fast-sass-loader\lib\index.js:206:19)
at importReplacer.throw (<anonymous>)
at onRejected (C:\code\openmct\node_modules\co\index.js:81:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
Child mini-css-extract-plugin node_modules/css-loader/index.js!node_modules/fast-sass-loader/lib/index.js!src/plugins/themes/snow-theme.scss:
Entrypoint mini-css-extract-plugin = *
ERROR in ./src/plugins/themes/snow-theme.scss (./node_modules/css-loader!./node_modules/fast-sass-loader/lib!./src/plugins/themes/snow-theme.scss)
ERROR in ./src/plugins/themes/snow-theme.scss (./node_modules/css-loader!./node_modules/fast-sass-loader/lib!./src/plugins/themes/snow-theme.scss)
Module build failed (from ./node_modules/fast-sass-loader/lib/index.js):
Error: import file cannot be resolved: "@import "~styles/vendor/normalize-min";" @C:\code\openmct\src\plugins\themes\snow-theme.scss
at Object.importReplacer (C:\code\openmct\node_modules\fast-sass-loader\lib\index.js:206:19)
at importReplacer.throw (<anonymous>)
at onRejected (C:\code\openmct\node_modules\co\index.js:81:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! openmct@1.0.0-snapshot build:prod: `cross-env NODE_ENV=production webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the openmct@1.0.0-snapshot build:prod 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\user\AppData\Roaming\npm-cache\_logs\2020-02-10T14_09_54_865Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! openmct@1.0.0-snapshot prepare: `npm run build:prod`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the openmct@1.0.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\user\AppData\Roaming\npm-cache\_logs\2020-02-10T14_09_54_905Z-debug.log
有人知道出什么问题吗?
非常感谢!
答案 0 :(得分:2)
类似Windows的问题,请参见this issue。
在文件夹“ openmct \ src \ plugins \ themes”中,我将* .scss文件中以“〜stytles”开头的路径替换为“ ../../styles”,安装成功。