运行错误&nbsp run dist'构建bootstrap4

时间:2018-05-29 16:29:00

标签: twitter-bootstrap npm bootstrap-4

我今天下载并解压缩了Bootstrap 4并收到错误:

设置

pwd
/Volumes/projects/bs4_temp/bootstrap-4.0.0
kevin $ dir
total 1432
drwxr-xr-x  14 kevin  staff   16384 28 May 15:36 .
drwxr-xr-x   8 kevin  staff   16384 29 May 15:15 ..
-rwxr-xr-x   1 kevin  staff     313 18 Jan 09:29 .babelrc.js
-rwxr-xr-x   1 kevin  staff     208 18 Jan 09:29 .editorconfig
-rwxr-xr-x   1 kevin  staff      56 18 Jan 09:29 .eslintignore
-rwxr-xr-x   1 kevin  staff    7123 18 Jan 09:29 .eslintrc.json
-rwxr-xr-x   1 kevin  staff     359 18 Jan 09:29 .gitattributes
drwxr-xr-x   2 kevin  staff   16384 18 Jan 09:29 .github
-rwxr-xr-x   1 kevin  staff     517 18 Jan 09:29 .gitignore
-rwxr-xr-x   1 kevin  staff      45 18 Jan 09:29 .stylelintignore
-rwxr-xr-x   1 kevin  staff    6685 18 Jan 09:29 .stylelintrc
-rwxr-xr-x   1 kevin  staff     782 18 Jan 09:29 .travis.yml
-rwxr-xr-x   1 kevin  staff      17 18 Jan 09:29 CNAME
-rwxr-xr-x   1 kevin  staff    3217 18 Jan 09:29 CODE_OF_CONDUCT.md
-rwxr-xr-x   1 kevin  staff     199 18 Jan 09:29 Gemfile
-rwxr-xr-x   1 kevin  staff    1905 18 Jan 09:29 Gemfile.lock
-rwxr-xr-x   1 kevin  staff    1131 18 Jan 09:29 LICENSE
-rwxr-xr-x   1 kevin  staff    9138 18 Jan 09:29 README.md
-rwxr-xr-x   1 kevin  staff    2505 18 Jan 09:29 _config.yml
drwxr-xr-x   2 kevin  staff   16384 18 Jan 09:29 _data
drwxr-xr-x   3 kevin  staff   16384 18 Jan 09:29 _includes
drwxr-xr-x   2 kevin  staff   16384 18 Jan 09:29 _layouts
drwxr-xr-x   2 kevin  staff   16384 18 Jan 09:29 _plugins
drwxr-xr-x   7 kevin  staff   16384 18 Jan 09:29 assets
drwxr-xr-x   2 kevin  staff   16384 18 Jan 09:29 build
-rwxr-xr-x   1 kevin  staff     744 18 Jan 09:29 composer.json
drwxr-xr-x   4 kevin  staff   16384 18 Jan 09:29 dist
drwxr-xr-x   3 kevin  staff   16384 18 Jan 09:29 docs
-rwxr-xr-x   1 kevin  staff    5430 18 Jan 09:29 favicon.ico
-rwxr-xr-x   1 kevin  staff    4384 18 Jan 09:29 index.html
drwxr-xr-x   5 kevin  staff   16384 18 Jan 09:29 js
drwxr-xr-x   2 kevin  staff   16384 18 Jan 09:29 nuget
-rwxr-xr-x   1 kevin  staff  433474 18 Jan 09:29 package-lock.json
-rwxr-xr-x   1 kevin  staff     530 18 Jan 09:29 package.js
-rwxr-xr-x   1 kevin  staff    9152 18 Jan 09:29 package.json
-rwxr-xr-x   1 kevin  staff     123 18 Jan 09:29 robots.txt
-rwxr-xr-x   1 kevin  staff     249 18 Jan 09:29 sache.json
drwxr-xr-x   4 kevin  staff   16384 18 Jan 09:29 scss
-rwxr-xr-x   1 kevin  staff     114 18 Jan 09:29 sw.js

kevin $ npm --version
6.1.0

错误

kevin $ npm run dist

> bootstrap@4.0.0 dist /Volumes/projects/bs4_temp/bootstrap-4.0.0
> npm-run-all --parallel css js

sh: npm-run-all: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! bootstrap@4.0.0 dist: `npm-run-all --parallel css js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the bootstrap@4.0.0 dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kevin/.npm/_logs/2018-05-29T16_20_07_838Z-debug.log

观察

[忽略这一点:我相信目前的版本是4.1,尽管看了几遍,但我每次尝试都会下载4.0.0。 ]

编辑 - 从另一台计算机下载4.1.1。这给出了相同的错误,也没有node_modules目录。

我上次在2月(在v4.0.0)看了这个,并在旧目录中运行相同的NPM命令。比较这两个目录,我在2月使用的目录有一个 node_modules 子目录,而当前的ZIP没有(git似乎也没有)。

这是我的问题,如果是这样,为什么今天ZIP文件中缺少 node_modules

1 个答案:

答案 0 :(得分:2)

通常it's not recommended在发布到网络时包含node_modules。

相反,用户需要使用NPM安装软件包(在本例中)。只需运行 npm install ,NPM就会为您创建文件夹。

聚苯乙烯。 NPM从package.json

中找到模块列表