npm install --production fails because of postinstall
olingerc opened this issue · 2 comments
olingerc commented
Hi,
The postinstall npm run webdriver-update
fails on my production system. What does this do? The system works without it. After googling a bit it is related to testing and protractor but since I use the --production flag, these dev packages will not be installed.
best regards,
Christophe
Foxandxss commented
That updates the tools to run e2e tests. You should not care about that in production.
I will see if I can find an alternative solution for not having to worry about that.
dannypule commented
"scripts": {
"postinstall": "node -e \"process.env.NODE_ENV != 'production' && process.exit(1)\" || npm run webdriver-update"
}
This fixed the issue for me by checking to see if the NODE_ENV is not equal to 'production' and if so, it exits. Otherwise in non-production environments it executes the script as per normal.