Comments (8)
Just for the record: I consider this postinstall
script (which according to e001097 helps “installing from GitHub”) to be a dirty hack to work around npm/npm#3055. But I can see the motivation to work around that for now. Just want to keep in mind that there may come a time when this script can be removed, since prepublish
will do all that's required.
from expect.
@gagern npm's prepublish doesn't do what it says it does, so we use postinstall instead. It's just there to create the lib
directory in case someone installs directly from GitHub (e.g. using npm install mjackson/expect
). npm/npm#3055 will further expand upon the meaning of "prepublish" which makes me even more wary of using it. It's fixing stuff that's broken with more brokenness.
I'd be happy to consider a PR using $NODE
instead of node
provided we can find someone with a Windows machine to test it out.
from expect.
I think it is worth noting that if someone is using the nodejs
binary on Ubuntu or Debian, they should probably get an error since (last I checked) the version of node those OSes shipped was 0.6 😢
from expect.
@phated: There are more recent versions of Node on the way, most notably Node 4 in testing:
- jessie: 0.10.29~dfsg-2
- stretch: 4.2.6~dfsg-1
- precise: 0.6.12~dfsg1-1ubuntu1
- trusty, vivid and wily: 0.10.25~dfsg2-2ubuntu1
- xenial: 4.2.6~dfsg-1ubuntu1
from expect.
I think it is worth noting that if someone is using the nodejs binary on Ubuntu or Debian
even modern versions of node have their binaries set to nodejs
. the workaround here is to use the node-legacy
package (which despite its name, actually packages modern versions, only with its binary named as node
)
from expect.
npm's prepublish doesn't do what it says it does, so we use postinstall instead.
Btw, in-publish exists as a workaround to this :)
from expect.
It's just there to create the lib directory in case someone installs directly from GitHub (e.g. using npm install mjackson/expect).
To be fair, the workaround doesn't actually work when doing this:
npm install mjackson/expect
...
npm ERR! [email protected] build: `babel ./modules -d lib --stage 0 --loose all --ignore '__tests__'`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] build script 'babel ./modules -d lib --stage 0 --loose all --ignore '__tests__''.
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 expect package,
IMHO, it's still better to use a prepublish
hook.
from expect.
Btw, in-publish exists as a workaround to this
I've tried using in-publish
before but AFAICT it gives Windows users problems because there is no ||
operator in CMD.exe, only &&
, which makes it impossible to restrict code to only running when you are not actually running as a result of npm publish
(i.e. in an npm install
).
the workaround doesn't actually work when doing this
Seems there's a bug.
from expect.
Related Issues (20)
- expect(2).toBeA('number') is not working on version 21.0.0 HOT 4
- Document that the jest code mods won't cover all cases? HOT 4
- False equality with Immutable Records HOT 2
- toBeA() not functioning as expected. HOT 1
- State of the library HOT 9
- "unpkg" link broken
- toBeA() function, throwing an 'undefined' error HOT 2
- toNotExist() issue HOT 7
- toBeA() returns an error saying it is not a function or cannot read property of HOT 4
- Add note about how optional messages work to documentation
- async / await in .toThrow HOT 2
- .toBeA() isn't functioning HOT 4
- expect.createSpy is not a function HOT 2
- TypeError: received.getMockName is not a function HOT 2
- TypeError: Cannot read property 'toBeA' of undefined HOT 1
- expect(...).toExist does not work HOT 4
- What can I do if I want to use this lib with mocha? HOT 8
- “test is not defined” jest/expect on client side HOT 3
- (...).toExist is not a function HOT 1
- Cannot include module 'expect' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expect.