zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
114 stars 86 forks source link

Problem installing Zowe CLI globally to Node.js that is installed as root #666

Closed plavjanik closed 2 years ago

plavjanik commented 4 years ago

Hello,

I have installed Node.js as root to /opt/nodejs/node-v12.15.0-linux-s390x/.

I am trying to install Zowe CLI using commands:

sudo su
VERSION=v12.15.0
DISTRO=linux-s390x
export PATH=/opt/nodejs/node-$VERSION-$DISTRO/bin:$PATH
npm install -g @zowe/cli

The Zowe CLI is installed at the end but I am getting a lot of error messages. Are they false alarms or real problems?

The full log:

[linux1@plape ~]$ sudo su
[root@plape linux1]# VERSION=v12.15.0
[root@plape linux1]# DISTRO=linux-s390x
[root@plape linux1]# export PATH=/opt/nodejs/node-$VERSION-$DISTRO/bin:$PATH
[root@plape linux1]# npm install -g @zowe/cli
/opt/nodejs/node-v12.15.0-linux-s390x/bin/bright -> /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/lib/main.js
/opt/nodejs/node-v12.15.0-linux-s390x/bin/zowe -> /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/lib/main.js

> @zowe/cli@6.7.2 postinstall /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli
> node ./scripts/validatePlugins

Since you re-installed Zowe CLI, we are re-validating any plugins.
[2020/02/07 07:02:92] [DEBUG] Writing all logged messages in memory to /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/imperative_debug.log
[2020/02/07 07:02:92] [INFO] Error: EACCES: permission denied, open '/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/imperative_debug.log'
[2020/02/07 07:02:92] [INFO] Error: EACCES: permission denied, open '/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/imperative_debug.log'
[2020/02/07 07:02:92] [FATAL] [Imperative.js:211] Error: EACCES: permission denied, mkdir '/root/.zowe/'
    at Object.mkdirSync (fs.js:823:3)
    at Function.createDirSync (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/io/src/IO.js:77:16)
    at Function.createDirsSync (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/io/src/IO.js:96:16)
    at Function.createDirsSyncFromFilePath (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/io/src/IO.js:110:12)
    at Function.initialize (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/settings/src/AppSettings.js:54:25)
    at Function.initAppSettings (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:344:32)
    at Function.<anonymous> (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:125:22)
    at Generator.next (<anonymous>)
    at /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:18:71
    at new Promise (<anonymous>) {
  errno: -13,
  syscall: 'mkdir',
  code: 'EACCES',
  path: '/root/.zowe/'
}
[2020/02/07 07:02:92] [INFO] Error: EACCES: permission denied, open '/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/imperative_debug.log'
[2020/02/07 07:02:92] [FATAL] [Imperative.js:213] Diagnostic information:
Platform: 'linux', Architecture: 's390x', Process.argv: '/opt/nodejs/node-v12.15.0-linux-s390x/bin/node /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/scripts/validatePlugins plugins validate'
Node versions: '{
  "node": "12.15.0",
  "v8": "7.7.299.13-node.16",
  "uv": "1.33.1",
  "zlib": "1.2.11",
  "brotli": "1.0.7",
  "ares": "1.15.0",
  "modules": "72",
  "nghttp2": "1.40.0",
  "napi": "5",
  "llhttp": "2.0.4",
  "http_parser": "2.9.3",
  "openssl": "1.1.1d",
  "cldr": "35.1",
  "icu": "64.2",
  "tz": "2019c",
  "unicode": "12.1"
}'Environmental variables: '{
  "npm_config_save_dev": "",
  "npm_config_legacy_bundling": "",
  "npm_config_dry_run": "",
  "npm_config_viewer": "man",
  "npm_config_only": "",
  "npm_config_commit_hooks": "true",
  "npm_config_browser": "",
  "npm_package_jest_coverageDirectory": "<rootDir>/__tests__/__results__/unit/coverage",
  "npm_config_also": "",
  "npm_package_deprecated": "false",
  "npm_package_publishConfig_registry": "https://registry.npmjs.org/",
  "XDG_SESSION_ID": "16",
  "npm_config_sign_git_commit": "",
  "npm_config_rollback": "true",
  "npm_package_devDependencies_jest_environment_node_debug": "^2.0.0",
  "npm_package_bin_bright": "lib/main.js",
  "HOSTNAME": "plape.novalocal",
  "NODE": "/opt/nodejs/node-v12.15.0-linux-s390x/bin/node",
  "npm_config_usage": "",
  "npm_config_audit": "true",
  "INIT_CWD": "/home/linux1",
  "npm_package_jest_testEnvironment": "node",
  "npm_package_devDependencies_typescript": "^3.7.4",
  "npm_package_homepage": "https://github.com/zowe/zowe-cli#readme",
  "npm_config_globalignorefile": "/opt/nodejs/node-v12.15.0-linux-s390x/etc/npmignore",
  "npm_package_devDependencies_madge": "^3.6.0",
  "npm_package_devDependencies_jest": "^24.9.0",
  "TERM": "xterm-256color",
  "SHELL": "/bin/bash",
  "npm_config_shell": "/bin/bash",
  "npm_config_maxsockets": "50",
  "npm_config_init_author_url": "",
  "npm_package_devDependencies_rimraf": "^2.6.3",
  "npm_package_devDependencies_jest_junit": "^6.3.0",
  "HISTSIZE": "1000",
  "TMPDIR": "/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli",
  "npm_config_shrinkwrap": "true",
  "npm_config_parseable": "",
  "npm_config_metrics_registry": "https://registry.npmjs.org/",
  "npm_package_devDependencies_tslint": "^5.20.1",
  "npm_package_devDependencies_ansi_colors": "^4.1.1",
  "npm_config_timing": "",
  "npm_config_init_license": "ISC",
  "npm_package_scripts_typedocSpecifySrc": "typedoc --options ./typedoc.json",
  "npm_package_scripts_lint": "npm run lint:packages && npm run lint:tests",
  "npm_package_scripts_installWithBuild": "npm install && npm run build",
  "npm_config_if_present": "",
  "npm_package_devDependencies_fs_extra": "^8.1.0",
  "npm_package_dependencies__zowe_imperative": "4.5.0",
  "npm_package_bin_zowe": "lib/main.js",
  "npm_config_sign_git_tag": "",
  "npm_config_init_author_email": "",
  "npm_config_cache_max": "Infinity",
  "npm_config_preid": "",
  "npm_config_long": "",
  "npm_config_local_address": "",
  "npm_config_git_tag_version": "true",
  "npm_config_cert": "",
  "npm_config_registry": "https://registry.npmjs.org/",
  "npm_config_noproxy": "",
  "npm_config_fetch_retries": "2",
  "npm_package_devDependencies_codepage": "^1.10.1",
  "npm_package_dependencies_js_yaml": "3.13.1",
  "npm_package_repository_url": "git+https://github.com/zowe/zowe-cli.git",
  "npm_config_versions": "",
  "npm_config_message": "%s",
  "npm_config_key": "",
  "npm_package_jest_watchPathIgnorePatterns_0": ".*jest-stare.*\\.js",
  "npm_package_devDependencies_gulp_plumber": "^1.2.1",
  "npm_package_description": "Zowe CLI is a command line interface (CLI) that provides a simple and streamlined way to interact with IBM z/OS.",
  "USER": "root",
  "npm_package_jest_collectCoverage": "false",
  "npm_package_devDependencies__types_js_yaml": "^3.11.1",
  "npm_package_license": "EPL-2.0",
  "LS_COLORS": "rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:",
  "SUDO_USER": "linux1",
  "npm_config_globalconfig": "/opt/nodejs/node-v12.15.0-linux-s390x/etc/npmrc",
  "SUDO_UID": "1001",
  "npm_config_prefer_online": "",
  "npm_config_logs_max": "10",
  "npm_config_always_auth": "",
  "npm_package_devDependencies__types_yargs": "^13.0.4",
  "npm_package_dependencies_ssh2": "0.8.7",
  "npm_package_jest_transform___ts_": "ts-jest",
  "npm_package_devDependencies_clear_require": "^2.0.0",
  "npm_package_devDependencies__types_jest": "^22.2.3",
  "npm_execpath": "/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/npm/bin/npm-cli.js",
  "npm_config_global_style": "",
  "npm_config_cache_lock_retries": "10",
  "npm_package_scripts_generateCleanTypedoc": "npm run typedoc && gulp cleanTypedoc",
  "USERNAME": "root",
  "npm_config_update_notifier": "true",
  "npm_config_cafile": "",
  "npm_package_devDependencies__types_ssh2": "^0.5.38",
  "npm_package_scripts_test_cleanUpProfiles": "sh __tests__/__scripts__/clean_profiles.sh",
  "npm_package_devDependencies_glob": "^7.1.6",
  "npm_package_scripts_doc_generate": "npm run doc:clean && gulp doc",
  "npm_package_author_name": "Broadcom",
  "npm_config_heading": "npm",
  "npm_config_audit_level": "low",
  "npm_config_searchlimit": "20",
  "npm_config_read_only": "",
  "npm_config_offline": "",
  "npm_config_fetch_retry_mintimeout": "10000",
  "npm_package_devDependencies_fancy_log": "^1.3.3",
  "npm_config_json": "",
  "npm_config_access": "",
  "npm_config_argv": "{\"remain\":[\"@zowe/cli\"],\"cooked\":[\"install\",\"--global\",\"@zowe/cli\"],\"original\":[\"install\",\"-g\",\"@zowe/cli\"]}",
  "npm_package_devDependencies_uuid": "^3.3.2",
  "npm_package_scripts_postinstall": "node ./scripts/validatePlugins",
  "MAIL": "/var/spool/mail/linux1",
  "PATH": "/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/.bin:/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/.bin:/opt/nodejs/node-v12.15.0-linux-s390x/bin:/sbin:/bin:/usr/sbin:/usr/bin",
  "npm_config_allow_same_version": "",
  "npm_package_devDependencies_typedoc": "^0.15.0",
  "npm_package_devDependencies_jest_stare": "^1.11.1",
  "npm_config_https_proxy": "",
  "npm_config_engine_strict": "",
  "npm_config_description": "true",
  "npm_package_jest_testRegex": "__tests__.*\\.(spec|test)\\.ts$",
  "_": "/opt/nodejs/node-v12.15.0-linux-s390x/bin/node",
  "npm_config_userconfig": "/root/.npmrc",
  "npm_config_init_module": "/root/.npm-init.js",
  "npm_package_devDependencies_ts_jest": "^24.2.0",
  "npm_package_devDependencies_gulp_debug": "^4.0.0",
  "npm_package_dependencies_get_stdin": "7.0.0",
  "npm_package_keywords_4": "z/OSMF",
  "npm_config_cidr": "",
  "npm_package_keywords_5": "mvs",
  "PWD": "/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli",
  "npm_config_user": "nobody",
  "npm_config_node_version": "12.15.0",
  "npm_package_jest_junit_output": "__tests__/__results__/junit.xml",
  "npm_package_keywords_6": "os390",
  "npm_package_bugs_url": "https://github.com/zowe/zowe-cli/issues",
  "npm_lifecycle_event": "postinstall",
  "npm_package_keywords_7": "z/OS",
  "npm_config_save": "true",
  "npm_config_ignore_prepublish": "",
  "npm_config_editor": "vi",
  "npm_config_auth_type": "legacy",
  "npm_package_jest_stare_coverageLink": "../unit/coverage/lcov-report/index.html",
  "npm_package_jest_collectCoverageFrom_3": "!**/main.ts",
  "npm_package_devDependencies_shebang_regex": "^2.0.0",
  "npm_package_imperative_configurationModule": "lib/imperative.js",
  "npm_package_keywords_0": "zosmf",
  "npm_package_repository_type": "git",
  "npm_package_name": "@zowe/cli",
  "LANG": "en_US.UTF-8",
  "npm_config_tag": "latest",
  "npm_config_script_shell": "",
  "npm_package_jest_collectCoverageFrom_2": "!packages/**/doc/I*.ts",
  "npm_package_scripts_test_integration": "cross-env FORCE_COLOR=1 jest \".*__tests__.*\\.integration\\.(spec|test)\\.ts\" --coverage false",
  "npm_package_keywords_1": "mainframe",
  "npm_config_progress": "true",
  "npm_config_before": "",
  "npm_config_global": "true",
  "npm_package_bundleDependencies": "false",
  "npm_package_jest_collectCoverageFrom_1": "!**/__tests__/**",
  "npm_package_scripts_build": "gulp updateLicense && tsc --pretty && npm run lint && npm run checkTestsCompile && madge -c lib",
  "npm_package_keywords_2": "CLI",
  "npm_config_searchstaleness": "900",
  "npm_config_optional": "true",
  "npm_config_ham_it_up": "",
  "npm_package_jest_collectCoverageFrom_0": "packages/**/*.ts",
  "npm_package_devDependencies_jest_environment_node": "^24.1.0",
  "npm_package_devDependencies__types_minimatch": "^3.0.3",
  "npm_package_scripts_lint_packages": "tslint --format stylish -c ./tslint-packages.json \"packages/**/*.ts\"",
  "npm_package_keywords_3": "zos",
  "npm_config_save_prod": "",
  "npm_config_force": "",
  "npm_config_bin_links": "true",
  "npm_package_scripts_checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/test-tsconfig.json --noEmit ",
  "npm_config_searchopts": "",
  "npm_package_engines_node": ">=8.0.0",
  "npm_config_node_gyp": "/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",
  "npm_config_depth": "Infinity",
  "npm_package_main": "lib/index.js",
  "npm_config_sso_poll_frequency": "500",
  "npm_config_rebuild_bundle": "true",
  "npm_package_devDependencies_gulp_cli": "^2.0.1",
  "npm_package_dependencies_minimatch": "3.0.4",
  "npm_package_scripts_watch": "tsc --pretty --watch",
  "npm_package_scripts_lint_tests": "tslint --format stylish -c ./tslint-tests.json \"**/__tests__/**/*.ts\"",
  "npm_package_version": "6.7.2",
  "npm_config_unicode": "true",
  "npm_package_jestSonar_reportPath": "__tests__/__results__/jest-sonar",
  "npm_package_keywords_8": "zowe",
  "HOME": "/root",
  "SUDO_COMMAND": "/bin/su",
  "SHLVL": "2",
  "npm_config_fetch_retry_maxtimeout": "60000",
  "npm_package_devDependencies_jest_sonar_reporter": "^2.0.0",
  "npm_package_scripts_watch_test": "jest --watch",
  "npm_package_scripts_test": "npm run test:unit && npm run test:integration && npm run test:system",
  "npm_config_tag_version_prefix": "v",
  "npm_config_strict_ssl": "true",
  "npm_config_sso_type": "oauth",
  "npm_config_scripts_prepend_node_path": "warn-only",
  "npm_config_save_prefix": "^",
  "npm_config_loglevel": "notice",
  "npm_config_ca": "",
  "npm_config_save_exact": "",
  "npm_config_group": "1001",
  "npm_config_fetch_retry_factor": "10",
  "npm_config_dev": "",
  "npm_package_devDependencies_gulp": "^4.0.2",
  "npm_package_devDependencies_cross_env": "^5.1.4",
  "npm_config_version": "",
  "npm_config_prefer_offline": "",
  "npm_config_cache_lock_stale": "60000",
  "npm_config_otp": "",
  "npm_config_cache_min": "10",
  "npm_package_jest_globals_ts_jest_disableSourceMapSupport": "true",
  "npm_package_devDependencies_ts_node": "^7.0.1",
  "npm_config_searchexclude": "",
  "npm_config_cache": "/root/.npm",
  "npm_package_typings": "lib/index.d.ts",
  "LOGNAME": "root",
  "npm_lifecycle_script": "node ./scripts/validatePlugins",
  "npm_config_color": "true",
  "npm_config_proxy": "",
  "npm_config_package_lock": "true",
  "npm_package_jest_modulePathIgnorePatterns_0": "__tests__/__snapshots__/",
  "npm_config_package_lock_only": "",
  "npm_config_fund": "true",
  "npm_package_jest_stare_additionalResultsProcessors_1": "jest-sonar-reporter",
  "npm_package_jest_moduleFileExtensions_1": "js",
  "npm_config_save_optional": "",
  "npm_package_jest_stare_additionalResultsProcessors_0": "jest-junit",
  "npm_package_jest_moduleFileExtensions_0": "ts",
  "npm_package_devDependencies__types_fs_extra": "^8.0.1",
  "LESSOPEN": "||/usr/bin/lesspipe.sh %s",
  "npm_config_ignore_scripts": "",
  "npm_config_user_agent": "npm/6.13.4 node/v12.15.0 linux s390x",
  "npm_package_devDependencies_jsonfile": "^4.0.0",
  "npm_package_files_3": "web-help/logo.png",
  "npm_config_cache_lock_wait": "10000",
  "npm_package_devDependencies_jest_cli": "^24.9.0",
  "npm_package_devDependencies_gulp_replace": "^0.6.1",
  "npm_package_devDependencies_chalk": "^2.4.2",
  "npm_package_devDependencies__types_node": "^12.12.24",
  "npm_package_files_2": "scripts",
  "npm_config_production": "",
  "npm_package_jest_stare_resultDir": "__tests__/__results__/jest-stare",
  "npm_package_scripts_test_system": "cross-env FORCE_COLOR=1 jest \".*__tests__.*\\.system\\.(spec|test)\\.ts\" --coverage false",
  "npm_package_files_1": "docs",
  "SUDO_GID": "1001",
  "npm_config_send_metrics": "",
  "npm_config_save_bundle": "",
  "npm_package_dependencies_string_width": "2.1.1",
  "npm_package_files_0": "lib",
  "npm_config_umask": "0022",
  "npm_config_node_options": "",
  "npm_config_init_version": "1.0.0",
  "npm_package_jest_coverageReporters_3": "cobertura",
  "npm_package_jest_testResultsProcessor": "jest-stare",
  "npm_package_jest_setupFilesAfterEnv_0": "./__tests__/beforeTests.js",
  "npm_package_scripts_typedoc": "typedoc --options ./typedoc.json ./packages/",
  "npm_config_init_author_name": "",
  "npm_config_git": "git",
  "npm_config_scope": "",
  "npm_package_jest_coverageReporters_2": "text",
  "npm_package_scripts_audit_public": "npm audit --registry https://registry.npmjs.org/",
  "npm_config_unsafe_perm": "",
  "npm_config_tmp": "/tmp",
  "npm_config_onload_script": "",
  "npm_package_jest_coverageReporters_1": "lcov",
  "npm_package_dependencies__zowe_perf_timing": "1.0.6",
  "npm_package_scripts_doc_clean": "rimraf docs/CLIReadme.md",
  "npm_package_scripts_test_cleanResults": "rimraf __tests__/__results__",
  "npm_node_execpath": "/opt/nodejs/node-v12.15.0-linux-s390x/bin/node",
  "npm_config_prefix": "/opt/nodejs/node-v12.15.0-linux-s390x",
  "npm_config_link": "",
  "npm_config_format_package_lock": "true",
  "npm_package_jest_coverageReporters_0": "json",
  "npm_package_scripts_test_unit": "cross-env FORCE_COLOR=1 jest \".*__tests__.*\\.unit\\.(spec|test)\\.ts\" --coverage"
}'
[2020/02/07 07:02:92] [INFO] Error: EACCES: permission denied, open '/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/imperative_debug.log'
[2020/02/07 07:02:92] [FATAL] [main.js:48] Error initializing Zowe CLI:
 ImperativeError: UNEXPECTED ERROR ENCOUNTERED
    at Function.<anonymous> (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:224:21)
    at Generator.next (<anonymous>)
    at /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:18:71
    at new Promise (<anonymous>)
    at __awaiter (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:14:12)
    at /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:103:78
    at new Promise (<anonymous>)
    at Function.init (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:103:16)
    at /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/lib/main.js:38:39
    at Generator.next (<anonymous>) {
  mDetails: {
    msg: 'UNEXPECTED ERROR ENCOUNTERED',
    causeErrors: Error: EACCES: permission denied, mkdir '/root/.zowe/'
        at Object.mkdirSync (fs.js:823:3)
        at Function.createDirSync (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/io/src/IO.js:77:16)
        at Function.createDirsSync (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/io/src/IO.js:96:16)
        at Function.createDirsSyncFromFilePath (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/io/src/IO.js:110:12)
        at Function.initialize (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/settings/src/AppSettings.js:54:25)
        at Function.initAppSettings (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:344:32)
        at Function.<anonymous> (/opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:125:22)
        at Generator.next (<anonymous>)
        at /opt/nodejs/node-v12.15.0-linux-s390x/lib/node_modules/@zowe/cli/node_modules/@zowe/imperative/lib/imperative/src/Imperative.js:18:71
        at new Promise (<anonymous>) {
      errno: -13,
      syscall: 'mkdir',
      code: 'EACCES',
      path: '/root/.zowe/'
    }
  },
  mMessage: 'UNEXPECTED ERROR ENCOUNTERED'
}
+ @zowe/cli@6.7.2
ghost commented 4 years ago

This looks related to #180. There are some known workarounds:

plavjanik commented 4 years ago

Thank you for mentioning #180. I have tried both --unsafe-perm and --ignore-scripts. I am not sure what is the better option. Both options sound scary.

I have installed it as root because Node.js was installed under root and I wanted Zowe CLI to be installed globally. I will not use Zowe CLI as root but as a regular user.

Ideally, I would like to see no errors (without any special option) when I am installing Zowe CLI to Node.js that was installed under root and no /root/.zowe created since I will not run Zowe CLI as root.

MikeBauerCA commented 4 years ago

Hi @plavjanik, someone else ran into this issue and we were able to resolve it by following this documentation: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

gejohnston commented 2 years ago

This issue has had no activity for 12 months. The issue also has less than 5 up-votes by the community. No action on this issue is targeted for the next 2 calendar quarters. Therefore, this issue is being closed. If you feel that this issue should continue to be available for community up-votes, you may reopen this issue.