cormacrelf / angular-skyhook

An implementation of react-dnd for Angular.
https://cormacrelf.github.io/angular-skyhook/
Other
164 stars 41 forks source link

Module not found: Error: Can't resolve 'angular-skyhook' #3

Closed krawuzikapuzi closed 6 years ago

krawuzikapuzi commented 6 years ago

Hey,

I am trying to use this library in my Angular6 app as shown on the Quickstart page by using:

npm install angular-skyhook
npm install react-dnd-html5-backend

and in my app.module.ts like so:

...
import { SkyhookDndModule } from 'angular-skyhook';
import { default as HTML5Backend } from 'react-dnd-html5-backend'

@NgModule({
  imports: [
    ...
    SkyhookDndModule.forRoot({ backend: HTML5Backend }),
  ], ....
})
export class AppModule {}

Just when running ng build I right away get the message

ERROR in ./src/app/app.module.ts
Module not found: Error: Can't resolve 'angular-skyhook' in 'C:\somePath\ClientApp\src\app'

"angular-skyhook": "^1.0.0", is part of package.json, I can see the folder and files in node_modules. I also updated my package-lock.json... am I missing something here?!

I stumbled upon this repo while struggling with dragula and trying to find a solution in the github issues of the dragula repo. It looks promising and I'd like to give it a try.

Thanks!

cormacrelf commented 6 years ago

I tried it from ng new and didn't get that error. I did get another one, though, a strange set of unknown characters in a definition file, and I have realised that I should publish the dist directory instead. Watch out for 1.0.1.

cormacrelf commented 6 years ago

Update: still coming, it's just that lerna monorepos are only slightly less of a nightmare than publishing manually.

cormacrelf commented 6 years ago

Ok, had to unpublish 1.0.1 and 1.0.2, but try npm i angular-skyhook again to pick up 1.0.3.

krawuzikapuzi commented 6 years ago

I updated to 1.0.3 and I am able to successfully build my project now, great! Thanks for your support!

cormacrelf commented 6 years ago

FYI, as the only known user of angular-skyhook, you get special news delivered in GH issues: there's a convenient multi-backend now. Check out the docs at https://cormacrelf.github.io/angular-skyhook/angular-skyhook-multi-backend/