Parcel: cssnano Host Key Verification Fails

Created on 16 Nov 2018  路  7Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

  > parcel build app.ts -d ../wwwroot/content --experimental-scope-hoisting --no-cache

  + [email protected]
  added 159 packages from 101 contributors, updated 10 packages and audited 604 packages in 7.706s
  found 0 vulnerabilities

  npm ERR! Error while executing:
  npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://[email protected]/cssnano/package.json.git
  npm ERR!
  npm ERR! Host key verification failed.
  npm ERR! fatal: Could not read from remote repository.
  npm ERR!
  npm ERR! Please make sure you have the correct access rights
  npm ERR! and the repository exists.
  npm ERR!
EXEC : npm ERR! exited with error code: 128 [C:\Users\mike\Documents\GitHub\Nancy3\src\App\App.csproj]

  npm ERR! A complete log of this run can be found in:
  npm ERR!     C:\Users\mike\AppData\Roaming\npm-cache\_logs\2018-11-16T19_55_57_445Z-debug.log
  螕锚脺  Built in 21.91s.

  ..\wwwroot\content\app.js     107.9 KB    21.87s
  ..\wwwroot\content\app.css    16.07 KB    20.91s
C:\Users\mike\Documents\GitHub\Nancy3\src\App\App.csproj(41,5): error MSB3073: The command "cd js
C:\Users\mike\Documents\GitHub\Nancy3\src\App\App.csproj(41,5): error MSB3073: npm run build-Release" exited with code
-1.

馃帥 Configuration (.babelrc, package.json, cli command)

package.json

{
  "name": "js",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build-Debug": "parcel build app.ts -d ../wwwroot/content --no-minify",
    "build-Release": "parcel build app.ts -d ../wwwroot/content --experimental-scope-hoisting --no-cache",
    "watch": "parcel watch app.ts -d ../wwwroot/content"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "es5-shim": "4.5.12",
    "es6-shim": "0.35.4",
    "mithril": "2.0.0-rc.1",
    "purecss": "1.0.0"
  },
  "devDependencies": {
    "@types/mithril": "1.1.13",
    "typescript": "3.1.6"
  }
}

tsconfig.json

{
  "compileOnSave": true,
  "compilerOptions": {
    /* Basic Options */
    "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
    "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
    // "lib": [],                             /* Specify library files to be included in the compilation:  */
    // "allowJs": true,                       /* Allow javascript files to be compiled. */
    // "checkJs": true,                       /* Report errors in .js files. */
    // "jsx": "preserve",                     /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
    // "declaration": true,                   /* Generates corresponding '.d.ts' file. */
    "sourceMap": true, /* Generates corresponding '.map' file. */
    // "outFile": "./",                       /* Concatenate and emit output to single file. */
    "outDir": "./tsout", /* Redirect output structure to the directory. */
    // "rootDir": "./",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
    // "removeComments": true,                /* Do not emit comments to output. */
    // "noEmit": true,                        /* Do not emit outputs. */
    // "importHelpers": true,                 /* Import emit helpers from 'tslib'. */
    // "downlevelIteration": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
    // "isolatedModules": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

    /* Strict Type-Checking Options */
    // "strict": true,                           /* Enable all strict type-checking options. */
    // "noImplicitAny": true,                 /* Raise error on expressions and declarations with an implied 'any' type. */
    // "strictNullChecks": true,              /* Enable strict null checks. */
    // "strictFunctionTypes": true,           /* Enable strict checking of function types. */
    // "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */
    // "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */

    /* Additional Checks */
    // "noUnusedLocals": true,                /* Report errors on unused locals. */
    // "noUnusedParameters": true,            /* Report errors on unused parameters. */
    // "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */
    // "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */

    /* Module Resolution Options */
    // "moduleResolution": "node",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
    // "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */
    // "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
    // "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */
    // "typeRoots": [],                       /* List of folders to include type definitions from. */
    // "types": [],                           /* Type declaration files to be included in compilation. */
    "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
    // "preserveSymlinks": true,              /* Do not resolve the real path of symlinks. */

    /* Source Map Options */
    // "sourceRoot": "./",                    /* Specify the location where debugger should locate TypeScript files instead of source locations. */
    // "mapRoot": "./",                       /* Specify the location where debugger should locate map files instead of generated locations. */
    // "inlineSourceMap": true,               /* Emit a single file with source maps instead of having a separate file. */
    // "inlineSources": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */

    /* Experimental Options */
    // "experimentalDecorators": true,        /* Enables experimental support for ES7 decorators. */
    // "emitDecoratorMetadata": true,         /* Enables experimental support for emitting type metadata for decorators. */
  }
}

2018-11-16T19_55_57_445Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'cssnano/package.json',
1 verbose cli   '-D' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session e1d7e73828241c96
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for github:cssnano/package.json Error while executing:
7 silly fetchPackageMetaData C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://[email protected]/cssnano/package.json.git
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData Host key verification failed.
7 silly fetchPackageMetaData fatal: Could not read from remote repository.
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData Please make sure you have the correct access rights
7 silly fetchPackageMetaData and the repository exists.
7 silly fetchPackageMetaData
7 silly fetchPackageMetaData exited with error code: 128
8 timing stage:rollbackFailedOptional Completed in 0ms
9 timing stage:runTopLevelLifecycles Completed in 2669ms
10 verbose stack Error: exited with error code: 128
10 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\util\finished.js:12:19)
10 verbose stack     at emitTwo (events.js:126:13)
10 verbose stack     at ChildProcess.emit (events.js:214:7)
10 verbose stack     at maybeClose (internal/child_process.js:915:16)
10 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
11 verbose cwd C:\Users\mike\Documents\GitHub\Nancy3\src\App\js\node_modules\purecss
12 verbose Windows_NT 10.0.17134
13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "cssnano/package.json" "-D"
14 verbose node v8.12.0
15 verbose npm  v6.4.1
16 error Error while executing:
16 error C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://[email protected]/cssnano/package.json.git
16 error
16 error Host key verification failed.
16 error fatal: Could not read from remote repository.
16 error
16 error Please make sure you have the correct access rights
16 error and the repository exists.
16 error
16 error exited with error code: 128
17 verbose exit [ 1, true ]

馃 Expected Behavior

Should run cssnano script without error

馃槸 Current Behavior

馃拋 Possible Solution

馃敠 Context

馃捇 Code Sample

git clone https://github.com/mike-ward/Nancy3.git
cd Nancy3
build.cmd

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.10.3
| Node | 8.12.0
| npm/Yarn | n/a
| Operating System | Windows 10
| Environment | Visual Studio Community 2017

Bug Confirmed Bug Autoinstall

Most helpful comment

Oh I see now. Looks like it鈥檚 trying to install cssnano/package.json and npm is resolving that to a git URL somehow. We need to parse that string to get the package name of `cssnano.
https://github.com/parcel-bundler/parcel/blob/75310e15f6fa3c8a0ce6593ada1bcca00240ea54/packages/core/parcel-bundler/src/transforms/postcss.js#L58

All 7 comments

Is this an autoinstall?

Seems like it's failing to install cssnano using npm. I don't think this is a parcel bug.

Is there a way to tell parcel to not use/load cssnano?

you can turn off minification

Parcel is trying to install cssnano and fails and the only way to work around the issue is to turn off minification. How is this not a Parcel issue? (I sincerely don't wish to appear rude, just trying to understand).

Oh I see now. Looks like it鈥檚 trying to install cssnano/package.json and npm is resolving that to a git URL somehow. We need to parse that string to get the package name of `cssnano.
https://github.com/parcel-bundler/parcel/blob/75310e15f6fa3c8a0ce6593ada1bcca00240ea54/packages/core/parcel-bundler/src/transforms/postcss.js#L58

@devongovett My build went from 890 seconds to 170 seconds after this change.
No more stalling on failed cssnano install, thanks.

Was this page helpful?
0 / 5 - 0 ratings