GithubHelp home page GithubHelp logo

lastboy / package-script Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 5.0 22 KB

package.json script extension for getting smooth installation process

Home Page: http://nodejscorner.blogspot.co.il/

License: MIT License

JavaScript 100.00%

package-script's People

Contributors

lastboy avatar mkxml avatar scottaddie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

package-script's Issues

[q]nvm support

Hi there!

do you plan to add nvm support?

2016-02-01 14:17:22.417  

************ Package Script  ************************************* process id: 31956
2016-02-01 14:17:22.444  Package Script : #node-sudo-passwd#
2016-02-01 14:22:43.345  

************ Package Script  ************************************* process id: 32665
2016-02-01 14:22:43.366  Package Script : #node-sudo-passwd#
2016-02-01 14:23:39.499  Package Script : Sorry, try again.

2016-02-01 14:23:39.501  Package Script : #node-sudo-passwd#
2016-02-01 14:27:14.790  Package Script : sudo: npm: command not found

2016-02-01 14:27:14.792  Package Script Complete 1
2016-02-01 14:27:14.804  Package Script : sudo: npm: command not found

2016-02-01 14:27:14.805  Package Script Complete 1
2016-02-01 14:27:14.815  Package Script : sudo: npm: command not found

2016-02-01 14:27:14.816  Package Script Complete 1
2016-02-01 14:27:14.828  Package Script : sudo: npm: command not found

2016-02-01 14:27:14.829  Package Script Complete 1
2016-02-01 14:27:14.842  Package Script : sudo: npm: command not found

2016-02-01 14:27:14.845  Package Script Complete 1
2016-02-01 14:27:14.846  [package-script] process completed, see pkgscript.log for more information

No Log

Hi,

how is it possible to switch off the log file?

please do not suggest installing other packages globally at install time

Please do not suggest that people install packages globally at install time. This is never necessary, and is horribly brittle and just generally bad behavior.

Consider the following:

  1. node_modules/.bin, ../node_modules/.bin, ../../node_modules/.bin, etc are already in the PATH when package scripts run. So, a package doesn't have to be global to be used in a script. So, globally installing deps is never required, and is unnecessary if the package (or one of its parents) has it installed locally.
  2. In a typical setup, a local install is run as the normal user, and /usr/local is root-owned. Globally run package scripts are executed as the nobody user, so you are virtually guaranteed to get a EACCES or EPERM if you install something globally in a package script. This is typically not allowed, and usually won't work, unless you chown your /usr/local or do some other non-default stuff.
  3. I may have a different version of grunt installed globally for a reason. If your (locally installed!) package overwrites it, that is a huge surprise! Packages should operate only within their own folders, and never outside of them.
  4. Build scripts that use grunt and the like at the command line should be run at prepublish time instead of at install time. Make grunt a devDependency, and run the script on prepublish instead of install.
  5. If you absolutely MUST run it at install time (and quite frankly, I've never seen a case other than binary builds with node-gyp where this is the case), then you won't be guaranteed to have your deps installed before install scripts run. In that case, list grunt (or whatever) as a bundledDependency so that you'll be guaranteed to have it from the start. You still don't need it installed globally, because the PATH is already set up to include it.

Is there a use case I'm missing that you believe requires installing things globally at your local package's install time? If so, let's address them in a different way, that doesn't rely on surprises and insecurity.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.