Skip to content
This repository was archived by the owner on Jan 17, 2022. It is now read-only.

No js files in npm package #135

Open
whatllb opened this issue Jun 10, 2017 · 9 comments
Open

No js files in npm package #135

whatllb opened this issue Jun 10, 2017 · 9 comments

Comments

@whatllb
Copy link

whatllb commented Jun 10, 2017

When I install via npm, it only contains typescript files.
I saw your repository has: build/angular-intro.min.js
I'm using node, npm, gulp, I need the js files. Ideally both src and build.

$ npm install angular-intro.js
$ cd node_modules/angular-intro.js/
$ ls src
ng-intro.component.ts
$ ls build
ng-intro.component.d.ts

@mendhak
Copy link
Owner

mendhak commented Jun 10, 2017

Created a PR you can test it like so:

"dependencies": {
    "angular-intro.js": "git://github.com/mendhak/angular-intro.js.git#issue135"
},

@whatllb
Copy link
Author

whatllb commented Jun 12, 2017

Strange, adding that line caused npm install errors

[...]m-mendhak-angular-intro-js-git-issue135-6f23faf2' does not appear to be a git repository
npm ERR! fatal: Could not read from remote repository.

But if I kept repeating the npm install, it eventually worked.

Yes, it produced .js files

$ cd node_modules/angular-intro.js/
$ ls src
'[deprectable]angular-intro.js' ng-intro.component.ts
$ ls build
angular-intro.min.js angular-intro.min.js.map ng-intro.component.d.ts

BTW, "deprectable" is a strange word. Do you mean "deprecated"? If so, angular-intro.deprecated.js might be a better choice. It would keep the standard filename prefix for your module and make it easier to manage copying them around (it would also mimic the intent of the file, like "min" does). For instance, I copy select module files into a "thirdparty" directory rather than deploying my "node_modules" directory. If I needed that src js file, then your project would be the only npm module I have with files that aren't prefixed by the module name. My gulpfile contains lots of lines like this, and I'm sure they don't collide with each other in thirdparty/js:

        // Analytics
        gulp.src([
            'node_modules/angulartics/dist/angulartics*.js',
            'node_modules/angulartics/src/angulartics*.js'
        ])
            .pipe(gulp.dest('thirdparty/js')),

@whatllb whatllb closed this as completed Jun 12, 2017
@whatllb
Copy link
Author

whatllb commented Jun 12, 2017

Oops, I didn't mean to close this. You still need to commit the solution.

@whatllb whatllb reopened this Jun 12, 2017
@ianqueue
Copy link

so what is the fix? I tried using the git://github.com/mendhak/angular-intro.js.git#issue135 but i dont get js files, as it stands I cant import angular-introjs into my app. I see there is a postinstall script, is that what creates the js files? when i do a npm run postinstall i get (node:27110) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

any help appreciated, thanks.

@mendhak
Copy link
Owner

mendhak commented Jun 26, 2017

The pull request is merged so just waiting on the next release to go out so that it gets pushed to npmjs.org

In the meantime - if the above didn't work, try the https version:

"dependencies": {
    "angular-intro.js": "https://github.com/mendhak/angular-intro.js.git#issue135"
}

Or even without the #issue135 - since it's merged into master:

    "angular-intro.js": "https://github.com/mendhak/angular-intro.js.git"

Then you will find the JS files in ./node_modules/angular-intro.js/build/

@ianqueue
Copy link

ah... import ngIntroJs from 'angular-intro.js/src/[deprectable]angular-intro'; works can't get the build paths to work... this is all odd

@ianqueue
Copy link

I cant seem to get the example working... does this work with angular 1.5.8? I updated your plunker for that cdn version and it breaks as well

@ianqueue
Copy link

nevermind... got things working, thanks

@whatllb
Copy link
Author

whatllb commented Jun 30, 2017

I'm not as adept at github as you are, and those special references are causing problems for my build environment. Often I'm getting errors trying to fetch with npm. I did get a copy to come down though.

I was using.
"angular-intro.js": "https://github.com/mendhak/angular-intro.js.git",

I'm see the src/[deprectable]angular-intro.js file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants