A
A
A_Pl2020-01-13 09:23:18
JavaScript
A_Pl, 2020-01-13 09:23:18

How to properly adapt package.json to run in windows 10 home?

...

"scripts": {
    "dev": "API_URL='https://localhost:8000/api/v1.1/' nuxt",
    "build": "NODE_ENV=production nuxt build",
    "start": "NODE_ENV=production  nuxt start",
    "generate": "nuxt generate",
    "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
    "fix-code": "prettier-eslint --write 'src/**/*.{js,jsx}' ",
    "fix-styles": "prettier-stylelint --write 'src/**/*.{css,scss}' "
  },

... I
try to run npm run dev, but it gives me that
"API_URL" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Kira, 2020-01-13
@Allan11

Maybe cross-env will help ?

A
Aetae, 2020-01-13
@Aetae

If you don't care about linkusoids, then API_URL => set API_URL

A
A_Pl, 2020-01-13
@A_Pl

Thanks, Kira, for a working version, but I would like to find a solution without installing additional plugins.
set API_URL didn't work in my case. The terminal just outputs this line:
, and vue won't start.

O
OniVe, 2020-01-13
@OniVe

package.json

{
  "scripts": {
    "dev": "dotenv -- nuxt",
    "build": "dotenv -- nuxt build",
    "start": "dotenv -- nuxt start",
    "generate": "dotenv -- nuxt generate"
  },
  "devDependencies": {
    "dotenv-cli": "^3.1.0"
  }
}

.env (put next to package.json)
API_URL=https://localhost:8000/api/v1.1/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question