Comments (6)
@udarrr Trust me, I am fully aware of what packages are being used.
Jackspeak depends on @isaacs/cliui, which depends on:
"strip-ansi": "^7.0.1",
"strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
What this does is that it tells npm (or any package manager that understands this syntax, which has been in npm for a very long time at this point, dating back to npm version 4, iirc) to install the version 7 of strip-ansi in node_modules/strip-ansi
, and install version 6 of strip-ansi in node_modules/strip-ansi-cjs
.
At run time, the cjs implementation of @isaacs/cliui does this, in `build/index.cjs':
const stripAnsi = require('strip-ansi-cjs')
and the ESM implementation in index.mjs
does this:
import stripAnsi from 'strip-ansi'
The module that gets loaded depends on whether you use import
or require
to load it, by referencing the package.json
's exports
field:
{
"exports": {
".": [
{
"import": "./index.mjs",
"require": "./build/index.cjs"
},
"./build/index.cjs"
]
}
}
This works with CommonJS, and it works with ESM, provided that you are using a package manager that is up to date and complete, and a node version since node 12.
That's why I asked, what are you installing and running it with?
Because I think you are using a broken package manager, and that is the problem. Usually when people report these sorts of problems, it's because they are using yarn version 1. If that's what you're using, I suggest you stop doing that.
from node-glob.
Can you clarify what is breaking and in which contexts?
I use glob 10 in many commonjs modules, it works fine.
from node-glob.
Yes @isaacs sure, generally it's because of strip-ansi 7.0.1 it's ESM currently. Dependencies from top to bottom are glob->jackspeak->@isaacs/cliui->strip-ansi.
Yes it works with version 10 but not with the latest
from node-glob.
What are you installing/running with? It works with node and npm.
from node-glob.
Let my explain. One of your dependency is being used strip-ansi since version 7.0.0 has been converted to ESM chalk/strip-ansi@7cda68d the dependency has been included to @isaacs/cliui. It's some kind of breaking changes and can't be used for packages with commonjs approach.
from node-glob.
Hi @isaacs yes you are right... Thank you for the clarification!
from node-glob.
Related Issues (20)
- Compile error with 10.3.8 HOT 3
- Typescript: Cannot find type declarations HOT 2
- Cannot find module 'glob' or its corresponding type declarations HOT 1
- add a flag like `--ignore-path` similar to Prettier HOT 1
- Are there return value examples for versions 7.1.6 and 10 glob.sync HOT 4
- Recent bump of `jackspeak` dep should have been a major version bump HOT 8
- Patch update 10.3.6 -> 10.3.7 appears to have multiple breaking changes HOT 3
- Redundant `//?/` HOT 4
- Clarify nocase documentation (specifically when setting it to not match OS behavior) HOT 2
- ignore option is not working with relative path HOT 1
- Using path.join no results HOT 1
- CWE-772 on dependency inflight HOT 1
- Memory leak in inflight dependency HOT 4
- Using vulnerable package inflight HOT 1
- `glob.sync(...)` is not returning values when `".."` and `nocase: true` are used together. HOT 2
- results are in reverse alphabetical order HOT 5
- npm i glob
- npm i glob
- `follow: true` doesn't follow more that 1 symbolic link HOT 7
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-glob.