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
I use Pacote to install packages in electron during runtime. I just updated from 13.0.4 to 15.0.3 and one of my test cases now fails with the error: DirFetcher requires either a tree or an Arborist constructor to pack.
This test case takes a valid package (only package.json) from an existing folder and extracts it to the installation folder.
After looking in to your source code, I found that Arborist is now required for extracting a directory. Simply importing Arborist as a dependency and including it as an option in the extract call seems to solve my problem. However, I have no idea what this actually does. Is this the correct solution to my problem or will this cause other problems in production with other specifier types?
Expected Behavior
Calling extract with just a source dir as spec and destination dir as dest should successfully move a valid package from ./pluginsSrc to ./plugins.
Steps To Reproduce
In a new npm project with pacoate as dependency, create a folder called pluginSrc and add a valid package.json in it.
Create another folder in the test folder called pluginDest
Execute the following js:
const { extract } = require("pacote")
extract('./pluginSrc', './ pluginDest')
Environment
npm: 8.15.0
Node: 16.17.0
OS: Windows 10
platform: ASUS Zenbook
The text was updated successfully, but these errors were encountered:
ilg@wksi ~ % pacote extract ~/tmp/empty ~/tmp/empty-dest
Error: DirFetcher requires either a tree or an Arborist constructor to pack
at DirFetcher.[pacote.Fetcher._tarballFromResolved] (/Users/ilg/.nvm/versions/node/v16.18.0/lib/node_modules/pacote/lib/dir.js:65:13)
at retry.retries (/Users/ilg/.nvm/versions/node/v16.18.0/lib/node_modules/pacote/lib/fetcher.js:330:64)
at /Users/ilg/.nvm/versions/node/v16.18.0/lib/node_modules/pacote/node_modules/promise-retry/index.js:29:24
ilg@wksi ~ %
where ~/tmp/empty is an empty project created with npm init.
The solution was indeed to import arborist and pass it to extract via the options
Is there an existing issue for this?
Current Behavior
Hi,
I use Pacote to install packages in electron during runtime. I just updated from 13.0.4 to 15.0.3 and one of my test cases now fails with the error: DirFetcher requires either a tree or an Arborist constructor to pack.
This test case takes a valid package (only package.json) from an existing folder and extracts it to the installation folder.
After looking in to your source code, I found that Arborist is now required for extracting a directory. Simply importing Arborist as a dependency and including it as an option in the extract call seems to solve my problem. However, I have no idea what this actually does. Is this the correct solution to my problem or will this cause other problems in production with other specifier types?
Expected Behavior
Calling extract with just a source dir as spec and destination dir as dest should successfully move a valid package from ./pluginsSrc to ./plugins.
Steps To Reproduce
const { extract } = require("pacote")
extract('./pluginSrc', './ pluginDest')
Environment
The text was updated successfully, but these errors were encountered: