我不能npm运行构建项目,npm ERR!缺少脚本:开始#411

时间:2019-08-02 04:47:07

标签: json npm build npm-install

我无法npm运行构建项目。我已经尝试了很多次,可能是因为package.json中缺少脚本文件。请别人帮忙。

编译步骤在以下步骤失败,并抛出“缺少脚本生成”错误 npm运行构建

通过检查package.json,看起来应该是

npm运行构建

package.json

{
    "title": "Resume",
    "name": "startbootstrap-resume",
    "version": "5.0.7",
    "scripts": {
        "start": "node_modules/.bin/gulp watch"
    },
    "description": "Resume is a simple, yet elegant resume and CV theme for Bootstrap 4.",
    "keywords": [
        "css",
        "sass",
        "html",
        "responsive",
        "theme",
        "template"
    ],
    "homepage": "https://startbootstrap.com/template-overviews/resume",
    "bugs": {
        "url": "https://github.com/BlackrockDigital/startbootstrap-resume/issues",
        "email": "feedback@startbootstrap.com"
    },
    "license": "MIT",
    "author": "Start Bootstrap",
    "contributors": [
        "David Miller (http://davidmiller.io/)"
    ],
    "repository": {
        "type": "git",
        "url": "https://github.com/BlackrockDigital/startbootstrap-resume.git"
    },
    "dependencies": {
        "@fortawesome/fontawesome-free": "5.9.0",
        "bootstrap": "4.3.1",
        "jquery": "3.4.1",
        "jquery.easing": "^1.4.1"
    },
    "devDependencies": {
        "browser-sync": "2.26.7",
        "del": "4.1.1",
        "gulp": "4.0.2",
        "gulp-autoprefixer": "6.1.0",
        "gulp-clean-css": "4.2.0",
        "gulp-header": "2.0.7",
        "gulp-plumber": "^1.2.1",
        "gulp-rename": "1.4.0",
        "gulp-sass": "4.0.2",
        "gulp-uglify": "3.0.2",
        "merge-stream": "2.0.0"
    }
}

终端

➜  CV run build git:(master) ✗ npm run build
npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zendy/.npm/_logs/2019-08-02T04_14_57_964Z-debug.log

错误

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm@6.9.0
3 info using node@v12.4.0
4 verbose stack Error: missing script: build
4 verbose stack     at run (/usr/local/lib/node_modules/npm/lib/run-script.js:155:19)
4 verbose stack     at /usr/local/lib/node_modules/npm/lib/run-script.js:63:5
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:115:5
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:418:5
4 verbose stack     at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:373:45)
4 verbose stack     at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:416:3)
4 verbose stack     at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:160:5)
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:364:12
4 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:90:16
4 verbose stack     at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
5 verbose cwd /Users/zendy/Downloads/CV run build
6 verbose Darwin 19.0.0
7 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
8 verbose node v12.4.0
9 verbose npm  v6.9.0
10 error missing script: build
11 verbose exit [ 1, true ]

我想成功运行构建以上传到服务器

0 个答案:

没有答案