【问题标题】:Failed to execute 'npm run dist' at command (node build/build-plugins.js) loader.js:775 MODULE_NOT_FOUND无法在命令 (node build/build-plugins.js) loader.js:775 MODULE_NOT_FOUND 处执行“npm run dist”
【发布时间】:2020-01-04 21:08:54
【问题描述】:

我目前正在关注 Bootstrap 的工具设置,但我真的很难理解这一点。

这是逐步过程的来源(https://getbootstrap.com/docs/4.3/getting-started/build-tools/

目前,我可以运行 npm 脚本(例如 npm run dist - 根据 Bootstrap 中的 package.json 文件)

在命令('npm run dist')期间,有一个命令被执行为: node build/build-plugins.js (我的 Bootstrap 根文件夹没有任何 build 文件夹!)

这是日志(使用 Git Bash - Windows)

> bootstrap@4.3.1 js-compile-plugins C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1
> node build/build-plugins.js


> bootstrap@4.3.1 css-compile-docs C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1
> cross-env-shell node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 site/docs/$npm_package_version_short/assets/scss/docs.scss site/docs/$npm_package_version_short/assets/css/docs.min.css


> bootstrap@4.3.1 js-compile-plugins-coverage C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1
> cross-env NODE_ENV=test node build/build-plugins.js

internal/modules/cjs/loader.js:775
    throw err;
    ^

Error: Cannot find module 'C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1\build\build-plugins.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap@4.3.1 js-compile-plugins-coverage: `cross-env NODE_ENV=test node build/build-plugins.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap@4.3.1 js-compile-plugins-coverage 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_39_217Z-debug.log
fs.js:127
    throw err;
    ^

Error: ENOENT: no such file or directory, lstat 'C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1\build'
    at Object.realpathSync (fs.js:1512:7)
    at runRollup (C:\Users\srebelo001\AppData\Roaming\npm\node_modules\rollup\dist\bin\rollup:1312:29)
    at Object.<anonymous> (C:\Users\srebelo001\AppData\Roaming\npm\node_modules\rollup\dist\bin\rollup:1363:5)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
    at internal/main/run_main_module.js:17:11 {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'C:\\Workspace\\risco-operacional\\RiscoOperacional\\packages\\bootstrap.4.3.1\\build'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap@4.3.1 js-compile-bundle: `rollup --environment BUNDLE:true --config build/rollup.config.js --sourcemap`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap@4.3.1 js-compile-bundle 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_39_354Z-debug.log
ERROR: "js-compile-plugins-coverage" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap@4.3.1 js-compile: `npm-run-all --parallel js-compile-* --sequential js-copy`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap@4.3.1 js-compile 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_39_938Z-debug.log
ERROR: "js-compile" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap@4.3.1 js: `npm-run-all js-compile js-minify js-copy`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap@4.3.1 js 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_39_973Z-debug.log
ERROR: "js" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap@4.3.1 dist: `npm-run-all --parallel css js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap@4.3.1 dist 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_40_318Z-debug.log

【问题讨论】:

    标签: windows npm


    【解决方案1】:

    您可能运行了npm install bootstrap 命令来下载Bootstrap 的源代码,所以您缺少build 文件夹。

    尝试使用 Composer 下载源代码。这些步骤对我有用:

    1. composer require twbs/bootstrap:4.5.0
    2. cd .\vendor\twbs\bootstrap\
    3. npm install
    4. npm run dist

    (Evn.:Windows 10 + PowerShell,已安装 npm、node.js、Ruby+Devkit 和 Bundler 和 Jekyll

    推荐使用说明:https://getbootstrap.com/docs/4.5/getting-started/build-tools/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-06
      • 2021-10-14
      • 2019-11-15
      • 2017-10-05
      • 2019-04-27
      • 1970-01-01
      • 2021-03-03
      • 1970-01-01
      相关资源
      最近更新 更多