user12929912
user12929912

Reputation:

npm ERR! missing script: build;

enter image description here

npm ERR! missing script: build; I’ve found it weird, what causes this issue?

Any ideas? I have added the fullstack error including the package.json. please also check the build.sh code below

Fullstack error

> eslint --quiet ./simple/js/*.js

npm ERR! missing script: build;
npm ERR!
npm ERR! Did you mean this?
npm ERR!     build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jgulle\AppData\Roaming\npm-cache\_logs\2020-08-18T08_34_05_215Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm run lint && (npm run build; cd server; npm install; node 
server.js)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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:

Package.json

{
  "name": "encrypt-decrypt-demo",
  "version": "1.0.3",
  "description": "Simple example to encrypt and decrypt files in the TDF spec using Virtru hosted KAS and EAS.",
  "scripts": {
    "build": ".simple/scripts/build.sh",
    "lint": "eslint --quiet ./simple/js/*.js",
    "start": "npm run lint && (npm run build; cd server; npm install; node server.js)",
    "watch": "nodemon --watch ./simple/js --ignore ./simple/js/build --exec 'npm run start'",
    "audit": "audit-ci --config .audit-ci.json"
  },
  "dependencies": {
    "browserify": "16.2.3",
    "moment": "2.24.0"
  },
  "devDependencies": {
    "audit-ci": "^2.3.0",
    "eslint": "^6.2.1",
    "eslint-config-airbnb-base": "^14.0.0",
    "eslint-plugin-import": "^2.18.2",
    "nodemon": "^1.19.1",
    "webpack-cli": "^3.3.6"
  }
}

build.sh code

cleanup(){
    if [ -f ./simple/js/build/demo-utils.js ]; then 
        rm ./simple/js/build/demo-utils.js; 
    fi
}

build(){
    browserify ./simple/js/browserify.js -o ./simple/js/build/demo-utils.js
}

cleanup && build

Upvotes: 1

Views: 13058

Answers (2)

Glitch
Glitch

Reputation: 1

This worked for me on git bash

npm config set script-shell=sh

You can set the script shell as cmd or sh. The later one works with semicolons.

Upvotes: 0

hedy
hedy

Reputation: 1208

"start": "npm run lint && npm run build && cd server && npm install && node server.js

It was trying to find a script named 'build;' with the semi colon, so change it to && with spaces

and the build script change it to:

"build": " bash simple/scripts/build.sh"

Upvotes: 2

Related Questions