Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build problem under windows #54

Closed
beihaifeiwu opened this issue Aug 17, 2015 · 5 comments
Closed

build problem under windows #54

beihaifeiwu opened this issue Aug 17, 2015 · 5 comments

Comments

@beihaifeiwu
Copy link

λ cnpm run build

> angular2-webpack-starter@0.0.0 build C:\Users\Administrator\git\angular2-webpack-starter
> npm run build:dev && npm run build:prod


> angular2-webpack-starter@0.0.0 build:dev C:\Users\Administrator\git\angular2-webpack-starter
>  npm run env:dev  npm run webpack --colors --display-error-details --display-cached


> angular2-webpack-starter@0.0.0 env:dev C:\Users\Administrator\git\angular2-webpack-starter
> NODE_ENV=development "npm" "run" "webpack"

'NODE_ENV' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "env:dev" "npm" "run" "webpack" "--colors" "--display-error-details" "--display-cached"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! angular2-webpack-starter@0.0.0 env:dev: `NODE_ENV=development "npm" "run" "webpack"`
npm ERR! Exit status 1

It looks like that the flow script cannot run as expected:

    "env:dev": "NODE_ENV=development",
    "env:prod": "NODE_ENV=production",
@PatrickJS
Copy link
Owner

do you think you can you open a Pull-Request? :)

@beihaifeiwu
Copy link
Author

I make it like this:

"env:dev": "SET NODE_ENV=development",
"env:prod": "SET NODE_ENV=production",

worked under winodws! output like:

λ npm run build

> angular2-webpack-starter@0.0.0 build C:\Users\Administrator\git\angular2-webpack-starter
> npm run build:dev && npm run build:prod


> angular2-webpack-starter@0.0.0 build:dev C:\Users\Administrator\git\angular2-webpack-starter
>  npm run env:dev  npm run webpack --colors --display-error-details --display-cached


> angular2-webpack-starter@0.0.0 env:dev C:\Users\Administrator\git\angular2-webpack-starter
> set NODE_ENV=development "npm" "run" "webpack"


> angular2-webpack-starter@0.0.0 build:prod C:\Users\Administrator\git\angular2-webpack-starter
> npm run env:prod npm run webpack --colors --display-error-details --display-cached


> angular2-webpack-starter@0.0.0 env:prod C:\Users\Administrator\git\angular2-webpack-starter
> set NODE_ENV=production "npm" "run" "webpack"

But I don't know if it work under linux and mac ?

@PatrickJS
Copy link
Owner

set won't work in linux and mac :/ I'm looking into ways to set the env that will work for both

@PatrickJS
Copy link
Owner

I removed prod/dev via c022ba9
I'm making a fullstack repo with server rendering so I'm going to keep this one client only

@RobHarrisAZ
Copy link

We had lots of problems getting this working under Windows. The problem ended up being npm running in a Windows Command Prompt. We installed Git for Windows (From Github) which also installs gitbash. Using the gitbash shell, executing the quick start and another window to also run the API server worked fine. Bottom line- don't waste your time trying to get this working from the Windows command prompt, it is expecting a bash-like shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants