-
Notifications
You must be signed in to change notification settings - Fork 29
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 find module 'angular2-autosize'. #22
Comments
The solution proposed by @MatthewMerrill in #20 worked for me |
I'm seeing this error and the solution proposed by @MatthewMerrill in #20 worked for me too |
Environment:
I was getting the compilation error : I have followed the suggested fixes from @MatthewMerrill #20 and tried variations on these But I'm still getting the following error on load : Apologies if there's something glaringly obvious I'm missing. Further details: tsconfig:
app.module:
|
Where is your node_modules folder relative to your src folder and what
version npm are you using?
…On Apr 11, 2017 8:17 AM, "fivedoor" ***@***.***> wrote:
Environment:
***@***.***
npm 3.8.9
typescript: ^2.0.3
@angular/common: ~2.1.1
I was getting the compilation error :
error TS2307: Cannot find module 'angular2-autosize'.
I have followed the suggested fixes from @MatthewMerrill
<https://github.com/MatthewMerrill> #20
<#20> and tried
variations on these
But I'm still getting the following error on load :
new-form: 48 Error: (SystemJS) XHR error (404 Not Found) loading
http://localhost:3000/node_modules/angular2-autosize/angular2-autosize
Apologies if there's something glaringly obvious I'm missing.
Really appreciate any pointers to resolving.
Thanks
Further details:
tsconfig:
{
"compilerOptions": {
"noImplicitAny": false,
"module": "commonjs",
"target": "ES5",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"declaration": true
},
"exclude": ["node_modules"]
}
app.module:
import { NgModule } from ***@***.***/core';
import { BrowserModule } from ***@***.***/platform-browser';
import { ReactiveFormsModule } from ***@***.***/forms';
import { FormsModule } from ***@***.***/forms';
import { HttpModule } from ***@***.***/http';
import { AppRoutingModule, routedComponents } from './app-routing.module';
import { AppComponent } from './app.component';
import { DataService } from './data.service';
import { FormComponent } from './form.component';
import { NewFormComponent } from './new-form.component';
import { CampaignResolve } from './campaign.resolve';
import { CampaignSearchComponent } from './campaign-search.component';
import { FormEditorComponent } from './form-editor.component';
import { CanDeactivateGuard } from './can-deactivate-guard.service'; //not used
import { Autosize } from '../node_modules/angular2-autosize/angular2-autosize';
// import { Autosize } from 'angular2-autosize/src/autosize.directive';
// import { Autosize } from '../angular2-autosize/src/autosize.directive';
// import { Autosize } from '../node_modules/angular2-autosize/src/autosize.directive';
// import { Autosize } from 'angular2-autosize/angular2-autosize';
// import { Autosize } from '../node_modules/angular2-autosize/angular2-autosize';
// import { Autosize } from '../../node_modules/angular2-autosize/angular2-autosize';
@NgModule({
imports: [
BrowserModule,
ReactiveFormsModule,
FormsModule,
HttpModule,
AppRoutingModule,
// Autosize
],
declarations: [
AppComponent,
routedComponents,
FormComponent,
NewFormComponent,
CampaignSearchComponent,
FormEditorComponent,
Autosize
],
providers: [
DataService,
CampaignResolve,
CanDeactivateGuard //not used
],
bootstrap: [ AppComponent ]
})
export class AppModule {
constructor() {
}
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFAXIPTbM3sRSlpmMEcJKxM2bDb5rZOYks5ru5mjgaJpZM4MgRyx>
.
|
The node_modules folder sits in main folder as does the ‘app’ folder. |
Status update: tbh this was more through trial and error than logic. Not quite sure why the above has resolved the issue. |
My project structure is like this
So in form-elements.module.ts, I'm doing Another option is to use the
Now in form-elements.module.ts, I can do |
After npm i angular2-autosize, and adding it to appmodule with:
import { Autosize } from 'angular2-autosize';
Compiller return error: "app.module.ts(10,42): error TS2307: Cannot find module 'angular2-autosize'."
If we import with directory 'angular2-autosize/angular2-autodize', compiller not send error, but web-page return "error: angular2-autosize 404 (Not Found)"
The text was updated successfully, but these errors were encountered: