scullyio / scully

The Static Site Generator for Angular apps
https://scully.io/
MIT License
2.55k stars 256 forks source link

ng add @scully/init #1413

Closed jam-one closed 2 years ago

jam-one commented 2 years ago

🐞 Bug report

Description

ng add @scully/init causes error, Angular 12 on Windows 10

🔬 Minimal Reproduction

ng add @scully/init

💻Your Environment

Windows 10 Angular Version:




D:\Angular12\my-blog>ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 12.1.4
Node: 16.5.0 (Unsupported)
Package Manager: npm 7.20.2
OS: win32 x64

Angular: 12.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1201.4
@angular-devkit/build-angular   12.1.4
@angular-devkit/core            12.1.4
@angular-devkit/schematics      12.1.4
@schematics/angular             12.1.4
rxjs                            6.6.7
typescript                      4.3.5

Warning: The current version of Node (16.5.0) is not supported by Angular.

Scully Version: 1.1.4




D:\Angular12\my-blog>type package.json
{
  "name": "my-blog",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~12.1.0",
    "@angular/common": "~12.1.0",
    "@angular/compiler": "~12.1.0",
    "@angular/core": "~12.1.0",
    "@angular/forms": "~12.1.0",
    "@angular/platform-browser": "~12.1.0",
    "@angular/platform-browser-dynamic": "~12.1.0",
    "@angular/router": "~12.1.0",
    "bootstrap": "^5.0.2",
    "rxjs": "~6.6.0",
    "tslib": "^2.2.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~12.1.4",
    "@angular/cli": "~12.1.4",
    "@angular/compiler-cli": "~12.1.0",
    "@types/jasmine": "~3.8.0",
    "@types/node": "^12.11.1",
    "jasmine-core": "~3.8.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "typescript": "~4.3.2"
  }
}

🔥 Exception or Error




i Using package manager: npm
√ Found compatible package version: @scullyio/init@1.1.4.
√ Package information loaded.

The package @scullyio/init@1.1.4 will be installed and executed.
Would you like to proceed? Yes
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @scullyio/init@1.1.4
npm WARN Found: @angular/platform-browser@12.1.4
npm WARN node_modules/@angular/platform-browser
npm WARN   peer @angular/platform-browser@"12.1.4" from @angular/platform-browser-dynamic@12.1.4
npm WARN   node_modules/@angular/platform-browser-dynamic
npm WARN     peer @angular/platform-browser-dynamic@"*" from @scullyio/ng-lib@1.1.1
npm WARN     node_modules/@scullyio/ng-lib
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @angular/platform-browser@"12.1.4" from @angular/platform-browser-dynamic@12.1.4
npm WARN node_modules/@angular/platform-browser-dynamic
npm WARN   peer @angular/platform-browser-dynamic@"*" from @scullyio/ng-lib@1.1.1
npm WARN   node_modules/@scullyio/ng-lib
npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! errno ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/yargs: 6232:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677:
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxxx\AppData\Local\npm-cache\_logs\2021-07-30T08_54_56_586Z-debug.log
× Package install failed, see above.
Jefiozie commented 2 years ago

Hi @jam-one could you verify if this problem is fixed with the develop version of scully?

jam-one commented 2 years ago

This problem has not been fixed. Here is what happens. npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @@. npm WARN Found: @@. npm WARN @./platform-browser npm WARN   peer @angular/platform-browser@"12.1.4" from @@. npm WARN   @./platform-browser-dynamic npm WARN     peer @angular/platform-browser-dynamic@"" from @**@. npm WARN     @./ng-lib npm WARN npm WARN Could not resolve dependency: npm WARN peer @angular/platform-browser@"12.1.4" from @@. npm WARN @./platform-browser-dynamic npm WARN   peer @angular/platform-browser-dynamic@"*" from @@. npm WARN   @./ng-lib npm WARN deprecated @.: Please update to ini >=1.3.6 to avoid a prototype pollution issue npm WARN deprecated @@.: this package has been renamed to ts-evaluator. Please install ts-evaluator instead npm WARN cleanup Failed to remove some directories [ npm WARN cleanup   [ npm WARN cleanup     @.\init', npm WARN cleanup     [Error: EPERM: operation not permitted, unlink @*.**@*.\angular\utility\ast-utils.js'] { npm WARN cleanup       errno: -4048, npm WARN cleanup       code: 'EPERM', npm WARN cleanup       syscall: 'unlink', npm WARN cleanup       path: @*.**@*.\angular\utility\ast-utils.js' npm WARN cleanup     } npm WARN cleanup   ], npm WARN cleanup   [ npm WARN cleanup     @.\init', npm WARN cleanup     [Error: EPERM: operation not permitted, unlink @.**@.\angular\utility\ast-utils.js'] { npm WARN cleanup       errno: -4048, npm WARN cleanup       code: 'EPERM', npm WARN cleanup       syscall: 'unlink', npm WARN cleanup       path: @.**@.\angular\utility\ast-utils.js' npm WARN cleanup     } npm WARN cleanup   ] npm WARN cleanup ] npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC npm ERR! 13596:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677: npm ERR!

npm ERR! A complete log of this run can be found in: npm ERR!     C:\Users\xxxx\AppData\Local\npm-cache_logs\2021-08-01T02_45_50_588Z-debug.log × Package install failed, see above.

The last 20 lines of the log file: $ tail -20 /cygdrive/c/Users/xxxx/AppData/Local/npm-cache/_logs/2021-08-01T02_45_50_588Z-debug.log 1550 warn cleanup     [Error: EPERM: operation not permitted, unlink @.**@.\angular\utility\ast-utils.js'] { 1550 warn cleanup       errno: -4048, 1550 warn cleanup       code: 'EPERM', 1550 warn cleanup       syscall: 'unlink', 1550 warn cleanup       path: @.**@.\angular\utility\ast-utils.js' 1550 warn cleanup     } 1550 warn cleanup   ] 1550 warn cleanup ] 1551 timing reify:rollback:createSparse Completed in 901088ms 1552 timing reify:rollback:retireShallow Completed in 358ms 1553 timing command:install Completed in 1108705ms 1554 verbose stack Error: 13596:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677: 1555 verbose cwd D:\Angular12\my-blog 1556 verbose Windows_NT 10.0.19043 1557 verbose argv "C:\Program Files\nodejs\node.exe" "C:\home\xxxx\npm\node_modules\npm\bin\npm-cli.js" "install" @.**@." "--quiet" 1558 verbose node v16.5.0 1559 verbose npm  v7.20.2 1560 error code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 1561 error 13596:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677: 1562 verbose exit 1

Cheers, Jam One

On Saturday, July 31, 2021, 6:25:01 PM GMT+7, Jeffrey Bosch ***@***.***> wrote:  

Hi @jam-one could you verify if this problem is fixed with the develop version of scully?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jam-one commented 2 years ago

Any solutions?

On Saturday, July 31, 2021, 6:25:01 PM GMT+7, Jeffrey Bosch ***@***.***> wrote:  

Hi @jam-one could you verify if this problem is fixed with the develop version of scully?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

SanderElias commented 2 years ago

@jam-one When I try this, it works for me: image

Can you verify there are no spaces or other non-ASCII characters in your path name. NodeJS on windows doesn't handle that combination properly.

jam-one commented 2 years ago

I run this using Windows 10 cmd as administrator.

D:\Angular12\my-blog>where npm C:\home\xxxx\npm\npm C:\home\xxxx\npm\npm.cmd C:\Program Files\nodejs\npm C:\Program Files\nodejs\npm.cmd D:\Angular12\my-blog>npm npm

Usage:

npm install        install all the dependencies in your project npm install   add the dependency to your project npm test           run this project's tests npm run       run the script named npm -h   quick help on npm -l             display usage info for all commands npm help     search for help on (in a browser) npm help npm       more involved overview (in a browser)

All commands:

    access, adduser, audit, bin, bugs, cache, ci, completion,     config, dedupe, deprecate, diff, dist-tag, docs, doctor,     edit, exec, explain, explore, find-dupes, fund, get, help,     hook, init, install, install-ci-test, install-test, link,     ll, login, logout, ls, org, outdated, owner, pack, ping,     pkg, prefix, profile, prune, publish, rebuild, repo,     restart, root, run-script, search, set, set-script,     shrinkwrap, star, stars, start, stop, team, test, token,     uninstall, unpublish, unstar, update, version, view, whoami

Specify configs in the ini-formatted file:     C:\Users\xxxx.npmrc or on the command line via: npm --key=value

More configuration info: npm help config Configuration fields: npm help 7 config

@.*** C:\home\xxxx\npm\node_modules\npm

D:\Angular12\my-blog>where node C:\Program Files\nodejs\node.exe

D:\Angular12\my-blog>node Welcome to Node.js v16.5.0. Type ".help" for more information.

.help .break    Sometimes you get stuck, this gets you out .clear    Alias for .break .editor   Enter editor mode .exit     Exit the REPL .help     Print this help message .load     Load JS from a file into the REPL session .save     Save all evaluated commands in this REPL session to a file

Press Ctrl+C to abort current expression, Ctrl+D to exit the REPL

.exit There are no spaces or non-ASCII characters in my path name. Cheers,Jam One

On Wednesday, August 4, 2021, 11:11:07 AM GMT+7, Sander Elias ***@***.***> wrote:  

@jam-one When I try this, it works for me:

Can you verify there are no spaces or other non-ASCII characters in your path name. NodeJS on windows doesn't handle that combination properly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

jam-one commented 2 years ago

In my nodejs directory I had a program named node.exe, I copied it and renamed the copy nodejs.exe. Then when I re-ran the command, it worked. D:\Angular12\my-blog>ng add @scullyio/init i Using package manager: npm √ Found compatible package version: @@.*** √ Package information loaded.

The package @@. will be installed and executed. Would you like to proceed? Yes √ Package successfully installed. @./init" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.     Install ng-lib     ✅️ Added dependency UPDATE src/polyfills.ts (3013 bytes) UPDATE package.json (1225 bytes) √ Packages installed successfully. @.***/init:scully" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.     ✅️ Update package.json UPDATE package.json (1299 bytes)

D:\Angular12\my-blog>ng generate @scullyio/init:markdown @./init:markdown" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID. @./init:markdown" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID. ? What name do you want to use for the module? posts ? What slug do you want for the markdown file? id ? Where do you want to store your markdown files? mdfiles ? Under which route do you want your files to be requested? posts     ✅️ Update scully.my-blog.config.ts CREATE src/app/posts/posts-routing.module.ts (409 bytes) CREATE src/app/posts/posts.component.html (153 bytes) CREATE src/app/posts/posts.component.spec.ts (621 bytes) CREATE src/app/posts/posts.component.ts (494 bytes) CREATE src/app/posts/posts.component.scss (131 bytes) CREATE src/app/posts/posts.module.ts (387 bytes) UPDATE scully.my-blog.config.ts (297 bytes) UPDATE src/app/app-routing.module.ts (707 bytes) @.***/init:post" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.     ✅️ Blog ./mdfiles/2021-08-04-posts.md file created CREATE mdfiles/2021-08-04-posts.md (99 bytes) So can you please check if that is the problem? Because I think by default when you install NodeJS on Windows it creates only a node.exe. Thanks for the help. Cheers,Jam One

On Wednesday, August 4, 2021, 11:11:07 AM GMT+7, Sander Elias ***@***.***> wrote:  

@jam-one When I try this, it works for me:

Can you verify there are no spaces or other non-ASCII characters in your path name. NodeJS on windows doesn't handle that combination properly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

SanderElias commented 2 years ago

So, it's somehow related to your environment. Closing this as there seems nothing left todo ;)

jam-one commented 2 years ago

Or you could upgrade your script to check for for node.exe in addition to nodejs.exe, since the default installation of NodeJS in windows only installs node.exe. This way other users won't face the same issue I experienced. Just a thought. Cheers,Jam One

On Thursday, August 5, 2021, 8:47:03 PM GMT+7, Sander Elias ***@***.***> wrote:  

So, it's somehow related to your environment. Closing this as there seems nothing left todo ;)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

SanderElias commented 2 years ago

We are nowhere calling nodejs in our code base. The text even doesn't exist in any of our source files. I don't think we are even calling out node itself directly. All the invocations are done through npm scripts.

jam-one commented 2 years ago

How weird. That was the only change I made and it worked. Well if anyone else has this error, it's an easy fix then. Cheers,Jam One.

On Friday, August 6, 2021, 9:59:23 AM GMT+7, Sander Elias ***@***.***> wrote:  

We are nowhere calling nodejs in our code base. The text even doesn't exist in any of our source files. I don't think we are even calling out node itself directly. All the invocations are done through npm scripts.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.