Konnektid / konnektid-js-utils

Several javascript utilities used throughout Konnektid
0 stars 0 forks source link

installation fails if babel-cli not present #13

Closed rewop closed 7 years ago

rewop commented 7 years ago

When installing the module in the package.json using npm i -S konnektid/konnektid-js-utils, installation fails with:

sergey@lxiby359-ubuntu:~/Projects/konnektid-graphql$ npm install --save konnektid/konnektid-js-utils

> konnektid-js-utils@0.2.0 postinstall /home/sergey/Projects/konnektid-graphql/node_modules/konnektid-js-utils
> npm run build

> konnektid-js-utils@0.2.0 build /home/sergey/Projects/konnektid-graphql/node_modules/konnektid-js-utils
> babel src --out-dir dist --ignore $npm_package_config_buildignore --source-maps --copy-files

You have mistakenly installed the `babel` package, which is a no-op in Babel 6.
Babel's CLI commands have been moved from the `babel` package to the `babel-cli` package.

    npm uninstall babel
    npm install babel-cli

See http://babeljs.io/docs/usage/cli/ for setup instructions.

npm ERR! Linux 4.4.0-42-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! konnektid-js-utils@0.2.0 build: `babel src --out-dir dist --ignore $npm_package_config_buildignore --source-maps --copy-files`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the konnektid-js-utils@0.2.0 build script 'babel src --out-dir dist --ignore $npm_package_config_buildignore --source-maps --copy-files'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the konnektid-js-utils package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel src --out-dir dist --ignore $npm_package_config_buildignore --source-maps --copy-files
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs konnektid-js-utils
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls konnektid-js-utils
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /home/sergey/Projects/konnektid-graphql/node_modules/konnektid-js-utils/npm-debug.log
npm ERR! Linux 4.4.0-42-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "konnektid/konnektid-js-utils"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! konnektid-js-utils@0.2.0 postinstall: `npm run build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the konnektid-js-utils@0.2.0 postinstall script 'npm run build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the konnektid-js-utils package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs konnektid-js-utils
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls konnektid-js-utils
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/sergey/Projects/konnektid-graphql/npm-debug.log

The problem appears to be that the postinstall runs npm run build which uses babel-cli. However babel-cli is declared as devDependency, which is not installed when installing the module in another one. So if the parent module does not have babel-cli the module fails to install.

Solution: