Closed
Description
Probably related to #3864
Bug Report or Feature Request (mark with an x
)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x
)
- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
node version: v8.11.3
npm version: 5.5.1
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.1.2
Node: 8.11.3
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.7.2
@angular-devkit/core 0.7.2
@angular-devkit/schematics 0.7.2
@schematics/angular 0.7.2
@schematics/update 0.7.2
rxjs 6.2.2
typescript 2.7.2
Repro steps
- Clone the project (project is generated with angular-cli, no other modules are added)
npm install
in parent folder (node-modules-parent-folder
)cd frontend
for angular project folderng serve
to build and run
The log given by the failure
You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
Desired functionality
It should automatically navigate to parent folder (as per node resolution) and find the @angular/core
and rxjs
.
Mention any other details that might be useful
- Issue should've been fixed based on this commit angular-cli doesn't work when node_modules is located in a parent directory #3864 (comment) which is merged in 6.1.2
- https://github.com/Magnetars/node-modules-parent-folder.git
- The project is a base ng project, no other modules are added. (You could create a new project instead of cloning)
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
is changed to point to"$schema": "../node_modules/@angular/cli/lib/config/schema.json",
(../node_modules instead of ./node_modules)
Please note that while this could simply be solved by installing the node_modules
in the Angular project folder, since my project is using server-side-rendering (using Angular Universal)
, it's more convenient to have the node_modules
in the parent folder shared by both frontend
and backend
My project structure is something like this:
+-- node-modules-parent-folder <-------- project folder
| +-- package.json <-------------------- package.json moved to parent folder
| +-- node_modules
| +-- frontend <------------------------ Angular project goes here
| +-- angular.json
| +-- backend <------------------------ Server code goes here
| +-- server.js
Metadata
Metadata
Assignees
Labels
No labels