1

I wish to manually install npm modules for my Angular project. I am behind a proxy and instead of setting the proxy information for my npm config file, I just wish to manually download npm modules and add them to my npm-cache/node_modules folders.

I have seen this old post but haven't found anything more recent: How to install a node.js module without using npm?

One of the modules I want to install is ng2-signalr. I went to GitHub, downloaded the source for the package, and added it to my node_modules folder.

After doing this I can import the module without error:

import { SignalRConfiguration } from 'ng2-signalr';

When I add code that uses the class:

const c = new SignalRConfiguration();

I get the following error:

index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.

Am I missing a step for manually installing a node module? Should I download to my npm cache folder?

I'm aware that I have to pay mind to dependencies of these manually installed modules. Also I know that the cache folder gets overwritten when you need to reinstall and that the node_modules folder is not usually included when you check in your source due to the size, but I only wish to experiment with the library.

Any advice?

RobC
  • 22,977
  • 20
  • 73
  • 80
afriedman111
  • 1,925
  • 4
  • 25
  • 42

1 Answers1

0

Add the directory or index file you wish to use in your Typescript config. Example in tsconfig.app.json:

"include": [
    "../path/to/library"
]

Rebuild after this. This is likely due to the 3rd party not setting up the package.json correctly.

bc1105
  • 1,270
  • 8
  • 8
  • This helped me eliminate the build errors, but I haven't been able to get the signalr module to work. Some problem with "negotiating the connection." – afriedman111 Apr 10 '18 at 17:48