question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

  • Laravel Mix Version: #.#.# (npm list --depth=0)
  • Node Version (node -v): 6.11
  • NPM Version (npm -v): 4.6
  • OS: Windows 10

Description:

Error on npm run dev:

John Doe [2:42 PM] 
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev" "--scripts-prepend-node-path=auto"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ dev script 'NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\j.doe\IdeaProjects\proj\frontend\src\main\resources\npm-debug.log

I think there’s a problem on WIndows with NODE_ENV

Steps To Reproduce:

npm run dev

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
mcanvarcommented, Oct 24, 2018

It works after adding cross-env before each NODE_ENV on the scripts.

1reaction
vqquoccommented, Feb 26, 2019

Many thanks @crx4 , it’s woking for my case 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - nodeenv : error when trying to start env
Well, got it by using verbose mode : $ nodeenv env -v. g++ was missing sudo apt-get install build-essential g++. Solves it !...
Read more >
Issues · ekalinin/nodeenv - GitHub
Wrong npm version when spawning nodeenv using npx. #309 opened on Jun 23 by Maxim-Mazurok ... nodeenv error message for improper proxy address...
Read more >
nodenv npm package not recognized : WEB-51045 - YouTrack
Try to add npm script run config and paste the npm location: ~/.nodenv/shims/npm 3. This happens: Error: Invalid npm/yarn package: file is specified, ......
Read more >
Error NODE ENV is not recognized as an internal or external ...
I'm trying to setup an environment for a Node.js app. but I'm getting this error: "NODE_ENV" is not recognized as an internal or...
Read more >
nodeenv - Python Package Health Analysis - Snyk
Learn more about nodeenv: package health score, popularity, security, ... Shows command output when error occurs; Excluded 'npm' from freeze list; Fixed bug...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found