code0wl / react-example-modern-javascript

The thinking in react demo recreated with modern javascript (aka ES15+ or es6+)
133 stars 31 forks source link

'TARGET' is not recognized as an internal or external command, operable program or batch file. #1

Closed ghost closed 8 years ago

ghost commented 8 years ago
C:\pkr\test\React\react-example-es2015-master>npm run build

> react-example-2015@1.0.0 build C:\pkr\test\React\react-example-es2015-master
> TARGET=build webpack

'TARGET' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\preddy\\AppData\
\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v4.1.1
npm ERR! npm  v3.3.8
npm ERR! code ELIFECYCLE
npm ERR! react-example-2015@1.0.0 build: `TARGET=build webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-example-2015@1.0.0 build script 'TARGET=build webpa
ck'.
npm ERR! This is most likely a problem with the react-example-2015 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     TARGET=build webpack
npm ERR! You can get their info via:
npm ERR!     npm owner ls react-example-2015
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\pkr\test\React\react-example-es2015-master\npm-debug.log
code0wl commented 8 years ago

Hi @pkpower I will have to look on the newer versions of node. Thanks for reporting!

gjcarrow commented 8 years ago

Is there any update on this? I'm having the same issue.

simba4everyoung commented 8 years ago

yeah.. any updates? I'm having the same issue too.

> TARGET=build webpack

'TARGET' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! react-lab@1.0.0 build: `TARGET=build webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-lab@1.0.0 build script 'TARGET=build webpack'.
npm ERR! This is most likely a problem with the react-lab package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     TARGET=build webpack
code0wl commented 8 years ago

It seems like more people are having this issue. Can you try a newer version of node? I do not have a Windows PC to test against sadly.

Thanks for reporting everyone.

iurii-kyrylenko commented 8 years ago

Just a workaround for Windows.

  1. In file webpack.config.js change line var TARGET = process.env.TARGET; to var TARGET = 'dev';
  2. In file package.json remove TARGET=dev from the scripts/start section
  3. Then run npm start My node version is 0.10.32
theptrk commented 8 years ago

Is this Azure? If it is, then I dont think the Windows server that is being used recognizes TARGET is a command. I've adjusted it so configuration is based on process.env variables instead of doing it inline like TARGET=build