Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot boot with external node_modules #8166

Closed
krukid opened this issue Nov 5, 2018 · 2 comments
Closed

Cannot boot with external node_modules #8166

krukid opened this issue Nov 5, 2018 · 2 comments

Comments

@krukid
Copy link

krukid commented Nov 5, 2018

I'm sure that at some point there was support for node_modules that were located outside of the Ember project root, however it's not clear to me if it's a living thing anymore. This feature is poorly documented, although I've been able to piece some info based on source code, closed issues and proof-of-concept projects, i.e.:

#3735
#3771
#7401
https://github.com/ember-cli/ember-cli/blob/master/lib/models/project.js#L352
https://github.com/bantic/test-app

There seem to have been 3 separate attempts at this:

  1. Elusive nodeModulesPath config key that has been deprecated (possibly addon-specific).
  2. Transient EMBER_NODE_PATH that seems to have some effect when combined with NODE_PATH, short of booting the app though.
  3. Some kind of module lookup refactoring intended to match native NodeJS lookup that does not seem to be working.

I have tried:

  1. setting nodeModulesPath, because it seemed like a logical thing to try;
  2. using Yarn with --modules-folder config in .yarnrc that Ember failed to detect;
  3. moving node_modules to one of the locations that native NodeJS lookup would find;
  4. using export EMBER_NODE_PATH=$HOME/.node_modules && export NODE_PATH=$EMBER_NODE_PATH, that prints:
root@112bd0501087:/app# ember s
WARNING:
WARNING: The 'package.json' file for the project at /app
WARNING:   specifies some missing dependencies:
WARNING:     @ember/jquery
WARNING:     @ember/optional-features
WARNING:     broccoli-asset-rev
WARNING:     ember-ajax
WARNING:     ember-cli
WARNING:     ember-cli-app-version
WARNING:     ember-cli-babel
WARNING:     ember-cli-eslint
WARNING:     ember-cli-htmlbars
WARNING:     ember-cli-htmlbars-inline-precompile
...
Missing template processor

So, maybe it's not supported anymore? Or broken? Or is there something I can tweak to make this work?


Output from ember version --verbose && npm --version && yarn --version:

ember-cli: 3.5.0
http_parser: 2.8.0
node: 10.8.0
v8: 6.7.288.49-node.19
uv: 1.22.0
zlib: 1.2.11
ares: 1.14.0
modules: 64
nghttp2: 1.32.0
napi: 3
openssl: 1.1.0h
icu: 62.1
unicode: 11.0
cldr: 33.1
tz: 2018e
os: linux x64
6.2.0
1.9.2
@krukid
Copy link
Author

krukid commented Nov 16, 2018

I've been able to work around this with Yarn workspaces. Some suggest using NPM with Lerna, but I haven't tried that yet.

@locks
Copy link
Contributor

locks commented Feb 10, 2022

Thanks for filling such a detailed issue! I am closing it as a lot has happened, what with Yarn workspaces, npm workspaces, etc, etc, that I think this would need to be re-thought.

@locks locks closed this as completed Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants