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

sh: cross-env: command not found #71

Closed
vorburger opened this issue May 27, 2018 · 3 comments
Closed

sh: cross-env: command not found #71

vorburger opened this issue May 27, 2018 · 3 comments

Comments

@vorburger
Copy link
Member

vorburger commented May 27, 2018

@edewit while trying to reproduce #70 with a local s2i I've hit this, in scratch/ not even in scratch3/ :

> Task :scratch:copyIcon
Download https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-x64.tar.gz
> Task :scratch:nodeSetup

> Task :scratch:npmSetup
/tmp/src/scratch/.gradle/npm/npm-v6.0.1/bin/npx -> /tmp/src/scratch/.gradle/npm/npm-v6.0.1/lib/node_modules/npm/bin/npx-cli.js
/tmp/src/scratch/.gradle/npm/npm-v6.0.1/bin/npm -> /tmp/src/scratch/.gradle/npm/npm-v6.0.1/lib/node_modules/npm/bin/npm-cli.js
+ npm@6.0.1
added 682 packages in 9.723s

> Task :scratch:npm_install UP-TO-DATE

> Task :scratch:npmBuildProd FAILED

> minecraft-js2@0.0.1 build:prod /tmp/src/scratch
> cross-env NODE_ENV=production webpack --config ./webpack.config.js  --progress --profile --color --display-error-details --display-cached --bail

sh: cross-env: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! minecraft-js2@0.0.1 build:prod: `cross-env NODE_ENV=production webpack --config ./webpack.config.js  --progress --profile --color --display-error-details --display-cached --bail`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the minecraft-js2@0.0.1 build:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /opt/jboss/.npm/_logs/2018-05-27T11_02_50_485Z-debug.log

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':scratch:npmBuildProd'.
> Process 'command '/tmp/src/scratch/.gradle/npm/npm-v6.0.1/bin/npm'' finished with non-zero exit value 1

wondering if this could be an impact of #60 ?

@vorburger
Copy link
Member Author

with a local s2i

actually this now happens even without S2I when runing pure locally, AFTER (due to #28) doing:

rm -rf scratch/.gradle/ scratch/node_modules

From what little I understand of node, perhaps this is interesting and doesn't seem right:

> Task :scratch:npm_install UP-TO-DATE
...
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

@vorburger
Copy link
Member Author

wondering if this could be an impact of #60 ?

no it's not, this problem still happens even after a revert of #60 like this:

git revert eb6ee408e1b6d69082f975a10ecdf1fb89793b8b

@vorburger
Copy link
Member Author

but with a fresh git clone or complete clean like this AT THE ROOT, not in scratch/ it works again:

git reset --hard; git clean -d -f -x

What is weird is that once I did this, it now always works again, every time.

Could this have anything to do with that weird package-lock.json file? Is this a good idea:

npm WARN conflict A git conflict was detected in package-lock.json. Attempting to auto-resolve.
npm WARN conflict To make this happen automatically on git rebase/merge, consider using the npm-merge-driver:
npm WARN conflict $ npx npm-merge-driver install -g

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

No branches or pull requests

1 participant