Questions tagged [cross-env]

cross-env is a tool for Python extension modules meant for cross-compiling.

cross-env is a tool for Python extension modules meant for cross-compiling. This tag is not meant to be used for questions that talk about any cross-environment issues. Only use for questions related to the Python plugin.

22 questions
5
votes
2 answers

how does cross-env command works in nodejs?

I have the following line in my package.json "scripts": { "start": "cross-env NODE_ENV=development node index.js" } I can see that "yarn start" command is running fine, but when I run "cross-env NODE_ENV=development node index.js" command…
yellowspectre
  • 51
  • 2
  • 4
4
votes
0 answers

Referencing a .env variable inside package.json with cross-env package

I want to define an url inside a .env file and then use it inside package.json using the cross-env package: # .env REACT_APP_TESET_URL=https://test.com // package.json { //... "scripts": { "start": "rescripts start" "start:test":…
Michal Kurz
  • 1,592
  • 13
  • 41
3
votes
0 answers

cross-env not updating meta.env variables with vite + vue3

I'm trying to specify env during start command like : "dev": "cross-env VITE_NODE_ENV=development && vite --host 0.0.0.0 --port 8080", But when console.log(import.meta.env) there is no VITE_NODE_ENV available. How to deal with this ?
Alexy
  • 780
  • 6
  • 22
3
votes
0 answers

Webpack environment variables confusion

edit: I think I answered my own question here I see many projects using cross-env with webpack but what for? I see webpack 4 has --mode option which sets NODE_ENV for us but you can only choose 3 values (production,development,none so this is…
Konrad
  • 6,385
  • 12
  • 53
  • 96
2
votes
0 answers

electron: --openssl-legacy-provider is not allowed in NODE_OPTIONS

I want create electron app with vue js but I can't start : I execute this code for run my app : "cross-env NODE_OPTIONS='--openssl-legacy-provider' vue-cli-service electron:serve" Return an error : electron: --openssl-legacy-provider is not allowed…
Arnaud
  • 121
  • 2
  • 6
2
votes
2 answers

Setting NODE_ENV differs between Mac and Windows

I work with a team of 4 and I'm the only Mac user and my peers are using Windows machine. My team members (Windows users) use the following which was not working on my Mac machine: "start": "set \"NODE_ENV=prod\" && node index.js" And when I tried…
Selvam Raju
  • 196
  • 4
  • 14
1
vote
1 answer

Quotations being added to combined npm script

I'm attempting to combine 2 npm scripts in one, but when I do the output is incorrect and causes flags to not be passed. Using the dotenv package is not an option and using ampersands is not helping. So in package.json I have this - "define:local":…
ssdev
  • 99
  • 6
1
vote
0 answers

Using cross-env-shell to run psql [npm script]

My scripts: "test": "cross-env NODE_ENV=test && npm run wipeTestDB && jest -c ./jest.unit.json", "wipeTestDB": "cross-env-shell \"psql -d $PG_TEST_URI -f server/scripts/DB.sql\"" I am getting a pSQL error when I run npm test, but when I have the dB…
donjewey
  • 23
  • 3
1
vote
1 answer

process.env.NODE_ENV is undefined in one project, but not another

I am using the react boilerplate framework to develop two projects. Both projects use cross-env to inject a value into the process.env.NODE_ENV. my webpack package.json is identical in both projects, and an excerpt is: "scripts":{ ... "build":…
pgee70
  • 3,707
  • 4
  • 35
  • 41
1
vote
1 answer

How to reference environment variables from .env file with cross-env?

I have to set node environment variables using cross-env in package.json but the values are in a .env file. I've tried the following formats but none has worked. cross-env API_KEY=%API_KEY% && ... cross-env API_KEY=$API_KEY && ... cross-env…
webflood
  • 11
  • 1
  • 1
  • 2
1
vote
0 answers

Programs can't find Cross-env

I got the source code from someone I know. But he uses Linux and I use Windows. I used the following command to run this program. "scripts": { "dev": "nodemon --watch src --watch package.json --watch tsconfig.js --delay 1 --exec 'cross-env…
riv_ms
  • 11
  • 1
1
vote
1 answer

sh: 1: cross-env: not in node js app found while deploying to heroku

i am trying to deploy my project to heroku, but this is what i get, i have tried everything i could but still this problem please help me, My package.JSON { "name": "storybooks", "version": "1.0.0", "description": "App for…
1
vote
0 answers

Cross-Env not found on production build

bin/sh/:1:cross-env: not found. error command failed with exit code 127 Using nextJs with the custom express server. If I remove cross-env from the script then it is showing Express is not found [2021-07-20 12:08:54] yarn run v1.22.10 [2021-07-20…
1
vote
0 answers

Showing error while running application in production mode of electron react boilorplate

I am geeting the follwoing error when I try to run the application in production mode. Running in development is working fine.Whe I try to run the app on production mode it is showing error.Error is file not found but file is already in the…
1
vote
3 answers

cross-env memory leak with npm run dev on Laravel Mix

I am installing a Laravel project (version 6.17.1) on a Docker Toolbox instance on a Windows 10 machine. Inside my Docker instance, I can run composer install fine, and npm i fine, but when I run npm run dev, but initially, I was getting error about…
party-ring
  • 1,761
  • 1
  • 16
  • 38
1
2