Comments (20)
Its happening for builds that install yarn fresh (new continuous integration servers). Upgrading to yarn 0.17.10 fixes it.
from node-emoji.
@mandragorn try uninstalling and reinstalling yarn, maybe clearing the yarn cache
from node-emoji.
Clearing the Yarn cache does seem to be the solution here. You should be able to do so by clearing the cache manually (OS-specific folder locations can be found in Yarn issue #2119), by running yarn cache clean
(if you're able to - I couldn't while this issue was happening), or by changing your Yarn version (I think).
from node-emoji.
@omnidan this entry-point change is an incompatible API change that breaks Semantic Versioning guidelines, which npm recommends for packages published to its repository. This breaking change should trigger a MAJOR version bump, otherwise it will continue to break downstream libraries that use a major-pinned version of this library as a dependency.
As far as I'm concerned, this issue is unresolved and will continue to cause dependency issues for any version of yarn
installed via npm (because it depends on a major-version-pinned "node-emoji": "^1.0.4"
in its package.json
) until a new PATCH or MINOR version of node-emoji
(1.4.3
or 1.5.0
) is published that reverts major-version 1.x
of this library to its original API behavior.
To follow-up, a MAJOR version of node-emoji
(2.0.0
) could be published with this API-breaking change without causing further issues.
from node-emoji.
@wjordan @omnidan It's worth noting that an entry point change is not viewed by everyone as an incompatible API change. The conversation around this node-uuid
issue is a good example.
The relevant point here is that this package still worked the same once the entry point was changed in v1.4.2
as it did in the previous v1.4.1
. So if you wanted to download it and use it directly like in the docs...
var emoji = require('node-emoji')
emoji.get('coffee')
...that code worked exactly the same before and after the entry point change, and nothing else in the public API was modified, so the minor version bump was probably fine. In the end, I guess it's up to the discretion of the library author in cases like this.
Ultimately though, the real problem here was with Yarn caching... a major version bump just happens to be a workaround.
from node-emoji.
@pdhoopr yes this is definitely an issue with yarn caching, but it's also not such an important change that it has to be released now. I'll keep this reverted until yarn fixes the issue. 😉 Thanks for all the comments!
from node-emoji.
@omnidan Excellent! Thanks for the super-quick response and release. The updated version did fix the issue in my build and unblocked my team quickly.
After looking into the issue further, it does seem that you're correct that this is a bug in Yarn's require-resolving cache that didn't respect package-dependency updates, and nothing to do with breaking semantic versioning in a strict sense. Sorry for the false alarm but I do appreciate the quick patch release nonetheless, and I'm sure you've helped save many others out there many hours of pain with that.
from node-emoji.
@cdpuk the require
call should read the main
property in package.json
, which is set to lib/emoji.js
, so everything should still work fine. I even tried this myself and node-emoji
still works as expected with 1.4.2 😁 let me know if this causes any issues for you.
from node-emoji.
Hello,
I have the same problem as cdpuk, seems it's not reading the package.json :/
from node-emoji.
@kevynb can you let me know what the issue is and how to reproduce it?
from node-emoji.
I just tried installing with npm (via npm install node-emoji
) and yarn (via yarn add node-emoji
), then executed the code from README:
var emoji = require('node-emoji')
emoji.get('coffee') // returns the emoji code for coffee (displays emoji on terminals that support it)
emoji.which(emoji.get('coffee')) // returns the string "coffee"
emoji.get(':fast_forward:') // `.get` also supports github flavored markdown emoji (http://www.emoji-cheat-sheet.com/)
emoji.emojify('I :heart: :coffee:!') // replaces all :emoji: with the actual emoji, in this case: returns "I ❤️ ☕️!"
emoji.random() // returns a random emoji + key, e.g. `{ emoji: '❤️', key: 'heart' }`
and everything works fine with both package managers.
from node-emoji.
Yep.
I did an npm install [email protected]
then yarn
which gave me:
14:38:50.327 - Run 'yarn'
14:38:50.541 /XXXXX/.nvm/versions/node/v6.9.1/lib/node_modules/yarn/bin/yarn.js:62
14:38:50.542 throw err;
14:38:50.542 ^
14:38:50.542
14:38:50.542 Error: ENOENT: no such file or directory, open '/XXXXX/.nvm/versions/node/v6.9.1/lib/node_modules/yarn/node_modules/node-emoji/index.js'
14:38:50.542 at Error (native)
14:38:50.542 at Object.fs.openSync (fs.js:640:18)
14:38:50.542 at Object.fs.readFileSync (fs.js:508:33)
14:38:50.542 at Object.Module._extensions..js (module.js:578:20)
14:38:50.542 at Module.load (module.js:487:32)
14:38:50.542 at tryModuleLoad (module.js:446:12)
14:38:50.542 at Function.Module._load (module.js:438:3)
14:38:50.542 at Module.require (module.js:497:17)
14:38:50.542 at require (internal/module.js:20:19)
14:38:50.543 at Object.<anonymous> (/XXXXXX/.nvm/versions/node/v6.9.1/lib/node_modules/yarn/lib/cli/commands/install.js:199:15)
from node-emoji.
@kevynb yarn
is specific to your project, can you create a minimal project on github (or just upload a package.json
), so I can reproduce this?
from node-emoji.
I tried it with my own package.json
:
{
"dependencies": {
"node-emoji": "^1.4.2"
}
}
Then ran yarn
, and everything works fine for me :/
I tried it with the latest yarn
version (0.17.10) and your version (0.17.8)
from node-emoji.
There are open issues with Yarn about this. I recently opened #2119, but #2072 is likely related and has more conversation around it.
from node-emoji.
@pdhoopr I see, seems like this is an issue related to the yarn cache. In that case, I'll close this issue, as it doesn't seem to be related to node-emoji. Thanks for all the comments, and feel free to reopen if you find out anything new 😄
from node-emoji.
I reproduce it on one machine but not the other. Trying to spot how it happens
I'll go rant on the yarn issue, sorry for the trouble @omnidan and thanks for your time
from node-emoji.
@kevynb no problem 😄 let me know if there's any news 😉
from node-emoji.
I'm getting the same problem, trying to figure out if I can fix it by clearing out yarn stuff.
from node-emoji.
@wjordan Thanks for the information! I released 1.4.3
reverting the changes in 1.4.2
and moved them to a 2.0
branch. Let me know if it works fine now.
from node-emoji.
Related Issues (20)
- Bug: emojis from Emoji Version 14.0 are not unemojified HOT 1
- Provide esm version HOT 2
- Convert to TypeScript
- Bump emojilib to 3.X HOT 1
- Problem with node-fetch and ERR_REQUIRE_ESM HOT 2
- emojify() misses some emojis in V2 HOT 1
- CJS support dropped in v2 HOT 1
- Tooling: add in more granular labels HOT 1
- Tooling: Add in Issue and PR Templates
- Add in JSDoc comments from DefinitelyTyped pull request
- `tsup` should be a dev dependency, rather than a dependency
- Typescript fix not released HOT 1
- Emojis from v1 not exist on v2 HOT 1
- Add a .extend(...) option to expand upon the built-in dictionary HOT 2
- 🛠 Tooling: Two workflows use the wrong org
- 🐛 Bug: CJS build of v2.1.1 imports an ESM-only module HOT 1
- 🛠 Tooling: Add test that CJS require() works (not just ESM import) HOT 4
- 🐛 Bug: Build error inside nuxt2 (Babel + Webpack) HOT 6
- 🚀 Feature: Add .only HOT 4
- 🛠 Tooling: Feature template includes Bug Report checklist
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 node-emoji.