uswds / uswds-gulp

A simple Gulp 4.0 workflow for transforming USWDS Sass into browser-readable CSS.
Other
35 stars 17 forks source link

uswds-gulp github install is not working on Federalist #32

Closed adborden closed 2 years ago

adborden commented 3 years ago

This might be a change in npm, but it looks like the lock file is generating a URL for uswds-gulp using ssh:// instead of https://. This breaks on Federalist and I believe will prevent other collaborators from running npm install unless they already have ssh configured for GitHub.

2021-03-01 22:08:36 INFO [setup-node] npm ERR! Error while executing:
2021-03-01 22:08:36 INFO [setup-node] npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/uswds/uswds-gulp.git
2021-03-01 22:08:36 INFO [setup-node] npm ERR!
2021-03-01 22:08:36 INFO [setup-node] npm ERR! Host key verification failed.
2021-03-01 22:08:36 INFO [setup-node] npm ERR! fatal: Could not read from remote repository.
2021-03-01 22:08:36 INFO [setup-node] npm ERR!
2021-03-01 22:08:36 INFO [setup-node] npm ERR! Please make sure you have the correct access rights
2021-03-01 22:08:36 INFO [setup-node] npm ERR! and the repository exists.
2021-03-01 22:08:36 INFO [setup-node] npm ERR!
2021-03-01 22:08:36 INFO [setup-node] npm ERR! exited with error code: 128
2021-03-01 22:08:42 INFO [setup-node] npm ERR! A complete log of this run can be found in:

I think the right solution is to publish uswds-gulp on npm.

My package.json contains:

"uswds-gulp": "github:uswds/uswds-gulp#5e32f1b99279a6e50ad875e66cc4cb77b456c390",

And the lockfile contains:

    "node_modules/uswds-gulp": {
      "resolved": "git+ssh://git@github.com/uswds/uswds-gulp.git#5e32f1b99279a6e50ad875e66cc4cb77b456c390"
    },

npm version 7.5.2

amstaker commented 3 years ago

I was also able to replicate the problem and for the past day this has pretty much been driving me slightly insane. I was able to confirm all packages were able to be installed except: uswds-gulp@github:uswds/uswds-gulp

If you try and install the package. Referring to the NPM documentation I attempted a few other permutations:

npm install git+ssh://git@github.com:uswds/uswds-site.git
npm install git+https://git@github.com/uswds/uswds-site.git
npm install https://git@github.com/uswds/uswds-site.git

I also have validated and I can connect securely to git, I even created a new set of keys. I can verify that the connection is working.

I was able to setup USWDS in the past without this particular problem occurring.

mejiaj commented 3 years ago

Thanks for bringing these issues up. We'll look into what could have possibly changed.

Would you mind including some steps to led you to this error?


Possible related to Unable to Add Required NPM Dependencies #33

amstaker commented 3 years ago

I am pretty sure that this is related to #33.

This issue can be easily replicated by running the following at the command line.

npm install autoprefixer gulp gulp-replace sass gulp-sass gulp-sourcemaps gulp-rename gulp-svg-sprite gulp-postcss postcss postcss-csso uswds uswds-gulp@github:uswds/uswds-gulp --save-dev

The causes an NPM error (likely related to the repo/install process) that ends with: npm ERR! Cannot convert undefined or null to object To more clearly see the error you can simply run: npm install uswds-gulp@github:uswds/uswds-gulp --save-dev All other packages can be installed via NPM. Cleaning and/or deleting the local NPM cache of files does not resolve this issue (either manually deleting the cache, or running the clean command).

amstaker commented 3 years ago

@mejiaj - just curious if we have any progress on this... I'm assuming this is stopping anyone from using a USWDS gulp workflow-based approach.

mejiaj commented 3 years ago

@amstaker sorry, we haven't been able to look at this issue quite yet. I've added it to our sprint board so we can take a look after our prioritized work is finished.

thisisdano commented 3 years ago

Update here:

Not totally sure what's up with this issue (the why), but for anyone using uswds-gulp, it's very likely that once you go through the process of setting it up, you can remove it as a dependency. That is, once you install all the peer dependencies and have a working gulpfile, uswds-gulp isn't doing anything. uswds-gulp is, at this point, not really a package and more of a basic way to scaffold a gulp setup.

We are close to launching and publishing uswds-gulp as a real npm package, with a much simpler and more straightforward way of working with it. See https://github.com/uswds/uswds-gulp/pull/39

Until this launches (probably about a month), I think the best fix is for teams to npm uninstall uswds-gulp — chances are, your project will work as expected without it.

thisisdano commented 2 years ago

Update, this npm package work I mentioned in the last comment got delayed, but you can track the new work in https://github.com/uswds/uswds-compile/pull/1. We should publish the new package — with the new API — this week.