OASIS-learn-study / minecraft-storeys-maker

Minecraft extension to make your own stories in, with and for Minecraft - it's like being a movie director!
https://www.learn.study
GNU Affero General Public License v3.0
15 stars 10 forks source link

sh: cross-env: command not found #71

Closed vorburger closed 6 years ago

vorburger commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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