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
{{ message }}
Repository navigation
Some packages can't find their dependencies, if modules-dir option is customized #3604
Snowpack complains about missing dependencies, even after shamefully hoisting. First I thought it was Snowpack's fault, but it works fine with npm & yarn.
@zkochan A path in NODE_PATH also helps ESlint plugin system.
So I really think prefixingmodules-dir path to NODE_PATH variable will help a lot, and will also complement the modules-dir option, as it exists to customize node_modules folder.
Without it module-dir option is kind of incomplete.
Activity
flosker commentedon Aug 6, 2021
@zkochan Any progress?
zkochan commentedon Aug 6, 2021
Why do you need custom module directory? If snowpack doesn't find it, probably it doesn't work with custom module directory names.
flosker commentedon Aug 6, 2021
When I manually added
modules-dirpath to NODE_PATH variable, Snowpack did find it'spostcssplugin.So adding that path does fixes the package missing issues.
Custom modules-dir path gives more control over project's organization structure.
flosker commentedon Aug 6, 2021
Off topic: Latest Snowpack doesn't work at all when installed with pnpm. With vanilla config.
Snowpack complains about missing dependencies, even after shamefully hoisting. First I thought it was Snowpack's fault, but it works fine with npm & yarn.
FredKSchott/snowpack#3594
flosker commentedon Aug 21, 2021
@zkochan A path in NODE_PATH also helps ESlint plugin system.
So I really think prefixing
modules-dirpath to NODE_PATH variable will help a lot, and will also complement themodules-diroption, as it exists to customize node_modules folder.Without it
module-diroption is kind of incomplete.fix(exec): look up commands in the configured modules directory
fix: put a custom modulesDir on the NODE_PATH of command shims
fix(install): link a project's bins into its own modules directory
fix: put the project modules directory first on NODE_PATH
fix(bins): reuse a shim when extraNodePaths repeats an entry
test: pass the tool output to JSON.parse as a string
refactor(cmd-shim): move shim_node_path into linking_paths
refactor: keep executor and CLI changes within the lint limits
3 remaining items
fix: put a custom modulesDir on the NODE_PATH of command shims
fix(install): link a project's bins into its own modules directory
fix: put the project modules directory first on NODE_PATH
fix(bins): reuse a shim when extraNodePaths repeats an entry
test: pass the tool output to JSON.parse as a string
refactor(cmd-shim): move shim_node_path into linking_paths
refactor: keep executor and CLI changes within the lint limits
test(executor): pass wd_bin_dir in tests added on main
test(cmd-shim): build the NODE_PATH fixture with native path joins
fix: honor modulesDir for commands and CommonJS plugins (#15211)
fix(bins-linker): respect custom modules-dir when resolving bin node …
fix: honor modulesDir for commands and CommonJS plugins (pnpm#15211)
fix(bins-linker): respect custom modules-dir when resolving bin node …
chore(deps): update pnpm to v12.6.0