1

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.

ozw1z5rd
  • 3,034
  • 3
  • 32
  • 49
  • Node normally searches your project's `node_modules`, so you don't need to explicitly do anything. What version of Node are you running? What OS? How did you install your project's dependencies? – tony19 Sep 01 '20 at 16:38
  • I updated the question – ozw1z5rd Sep 01 '20 at 20:18

0 Answers0