You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
file:///Users/oscarotero/test/main.ts (44B)
└── Could not find a matching package for 'npm:[email protected]' in '/Users/oscarotero/test/package.json'. You must specify this as a package.json dependency when the node_modules folder is not managed by Deno. (resolve error)
I don't understand what it means. Should I create a package.json file with this? Anyway, I did it:
{
"dependencies": {
"micromatch": "4.0.5"
}
}
And now I have the following error:
file:///Users/oscarotero/test/main.ts (44B)
└── Could not find '/Users/oscarotero/test/node_modules/micromatch/package.json'. Deno expects the node_modules/ directory to be up to date. Did you forget to run `npm install`? (resolve error)
As far as I understand, I have to install the package with NPM? What's the point of that? Anyway, I run npm i and then deno info main.ts again, which returns the following error:
file:///Users/oscarotero/test/main.ts (44B)
├── file:///Users/oscarotero/test/node_modules/micromatch/index.js (unknown)
└── Failed resolving package subpath for 'npm:[email protected]' in '/Users/oscarotero/test/node_modules/micromatch'. (resolve error)
And now I'm lost. Any idea how to make it work?
The text was updated successfully, but these errors were encountered:
This is tracked in #18191 (Import maps currently can't be used to change dependencies of npm packages, but yeah, byonm would be the way to do this atm)
I opened #23507 for the other issue you mentioned.
Version: Deno 1.42.4
I'm trying to replace a npm dependency using import maps, but suprisingly it doesn't seem to work.
Let's say I have this code:
If I run
deno info main.ts
I have the following dependency graph:To replace
[email protected]
with another version, say[email protected]
, I add a new entry in the import map:But after running
deno info main.ts
again, I see the same result without any change.I tried different ways without luck:
I saw this issue #23310 and from I understand, I have to enable the unstable
byonm
feature. So I added it to mydeno.json
file:Now I have the following error:
I don't understand what it means. Should I create a
package.json
file with this? Anyway, I did it:And now I have the following error:
As far as I understand, I have to install the package with NPM? What's the point of that? Anyway, I run
npm i
and thendeno info main.ts
again, which returns the following error:And now I'm lost. Any idea how to make it work?
The text was updated successfully, but these errors were encountered: