1

I want to publish my nodeJS build folder or ftp so in Cmd I write npm run build but it give that error In webpack or package.json I set Node_ENV to production

 18 error react-seed@0.0.13 build: `NODE_ENV=production npm run webpack`
    18 error Exit status 1
    19 error Failed at the react-seed@0.0.13 build script
   'NODE_ENV=production npm run webpack'.
    19 error This is most likely a problem with the react-seed package,
    19 error not with npm itself.
    19 error Tell the author that this fails on your system:
    19 error     NODE_ENV=production npm run webpack

How can I publish my project to any folder or ftp?

user1688401
  • 1,851
  • 8
  • 47
  • 83
  • Are you building on windows by any chance? `NODE_ENV=production` isn't the correct syntax for windows. – dvlsg Apr 20 '16 at 18:02
  • @dvlsg yes on windows.It create folder like this $npm_package_config_buildDir but it is empty.No file in that folder – user1688401 Apr 20 '16 at 18:19

1 Answers1

0

react-seed didn't make their npm scripts cross-platform compliant, as can be seen here.

You could manually change the package.json in react-seed to be windows compliant, by editing the script build line to use this instead:

"build": "set NODE_ENV=production&& npm run webpack",

The missing space after production is intentional. Also note that this would make it not run on *nix environments, as it would be windows specific.

Honestly, it may be best to open a ticket with react-seed and let them know that their npm scripts are not cross-platform. Additional reading from stackoverflow here.

Community
  • 1
  • 1
dvlsg
  • 5,378
  • 2
  • 29
  • 34