node vue-cli-service not found

369 views Asked by At

I have a problem with vue-cli-service. I'm a newbie to FE development, so be patient if my question is silly.

Node is at version 14.9.x Os is macOS Catalina, however, the same will run inside Jenkins pipeline so the final OS will be Centos 7. Dependencies have been installed using: npm install <package name>. At the moment the package.json and package-lock.json seem to contain all the stuff I need.

If I execute:

./node_modules/.bin/vue-cli-service build --mode development

Everything runs fine and I think that vue-cli-service has not been added to the search path. In my package.json file I putted:

{
    "name": "WebApp",
    "version": "0.1.0",
    "private": true,
    "scripts": {
        "serve": "vue-cli-service serve --port 8081",
        "build:development": "./node_modules/.bin/vue-cli-service build --mode development",
        "build:staging": "vue-cli-service build --mode staging",
        "build:production": "vue-cli-service build --mode production",
        "build:preproduction": "vue-cli-service build --mode preproduction",
        "test": "vue-cli-service test",
        "lint": "vue-cli-service lint"
    },
    :
    . 

If I execute: npm run build:production nothing works, If I run npm run build:development, it works, but I'm hardcoding a path with the command. How can I avoid to stick the path in the package.json file? Any suggestion is welcomed.

0

There are 0 answers