Stuck in npm install - M1 Mac - npm-install

I moved to an M1 Mac about a month ago, and I was able to solve most of the compatibility problems but I have this Node project I cannot get it to install.
I'm running node v12.19.1 (npm 7.5.4) using x64. Let me know if I need to provide any other logs, or try any other different command
~/projects/cybersource | master *2 npm i --verbose
INT | 16s | 12.19.1 node | 20:45:38
npm verb cli [
npm verb cli '/Users/agustin/.nvm/versions/node/v12.19.1/bin/node',
npm verb cli '/Users/agustin/.nvm/versions/node/v12.19.1/bin/npm',
npm verb cli 'i',
npm verb cli '--verbose'
npm verb cli ]
npm info using npm#7.5.4
npm info using node#v12.19.1
npm timing config:load:defaults Completed in 2ms
npm timing config:load:file:/Users/agustin/.nvm/versions/node/v12.19.1/lib/node_modules/npm/npmrc Completed in 2ms
npm timing config:load:builtin Completed in 2ms
npm timing config:load:cli Completed in 1ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:/Users/agustin/projects/cybersource/.npmrc Completed in 0ms
npm timing config:load:project Completed in 0ms
npm timing config:load:file:/Users/agustin/.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:/Users/agustin/.nvm/versions/node/v12.19.1/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:cafile Completed in 0ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:setUserAgent Completed in 1ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 8ms
npm verb npm-session 7f6390bbda9e4a7b
npm timing npm:load Completed in 16ms
npm timing arborist:ctor Completed in 0ms
npm timing arborist:ctor Completed in 0ms
npm timing idealTree:init Completed in 25ms
npm timing idealTree:userRequests Completed in 0ms
npm http fetch GET 304 https://registry.npmjs.org/#nestjs%2fcommon 257ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/reflect-metadata 67ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/rxjs 57ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/#nestjs%2fcore 85ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/#nestjs%2fplatform-express 454ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/#nestjs%2fswagger 168ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/#types%2fcrypto-js 311ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/#types%2fdotenv 136ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/#types%2fuuid 165ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/#types%2fxml2js 175ms (from cache)
⸨░░░░░░░░░░░░░░░░░░⸩ ⠧ idealTree:cybersource: http fetch GET 304 https://registry.npmjs.org/#types%2fxml2js 175ms (from cache)

Related

npm ERR! code ENOENT. Does not create a new package.json or install dependencies

I wanted to start a new package.json with npm init -y from the windows cmd and the console throws an error.
I tried to solve it this way and it didn't work.
Remove the npm cache with npm cache clean --force.
Update to the latest version of npm
Install the latest version of LTS node.
Uninstall and install node and it didn't work.
C:\Users\ADMIN\Documents\server>npm init -y
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\ADMIN\Documents\server\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\ADMIN\Documents\server\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ADMIN\AppData\Local\npm-cache\_logs\2023-01-12T00_47_42_486Z-debug-0.log
The npm cache error log
> 0 verbose cli C:\Program Files\nodejs\node.exe
> C:\Users\ADMIN\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js 1
> info using npm#9.2.0 2 info using node#v18.13.0 3 timing
> npm:load:whichnode Completed in 0ms 4 timing config:load:defaults
> Completed in 2ms 5 timing
> config:load:file:C:\Users\ADMIN\AppData\Roaming\npm\node_modules\npm\npmrc
> Completed in 3ms 6 timing config:load:builtin Completed in 3ms 7
> timing config:load:cli Completed in 2ms 8 timing config:load:env
> Completed in 0ms 9 timing config:load:project Completed in 3ms 10
> timing config:load:file:C:\Users\ADMIN\.npmrc Completed in 1ms 11
> timing config:load:user Completed in 1ms 12 timing
> config:load:file:C:\Users\ADMIN\AppData\Roaming\npm\etc\npmrc
> Completed in 0ms 13 timing config:load:global Completed in 1ms 14
> timing config:load:setEnvs Completed in 1ms 15 timing config:load
> Completed in 14ms 16 timing npm:load:configload Completed in 14ms 17
> timing npm:load:mkdirpcache Completed in 0ms 18 timing
> npm:load:mkdirplogs Completed in 0ms 19 verbose title npm doctor 20
> verbose argv "doctor" 21 timing npm:load:setTitle Completed in 2ms 22
> timing config:load:flatten Completed in 3ms 23 timing npm:load:display
> Completed in 4ms 24 verbose logfile logs-max:10
> dir:C:\Users\ADMIN\AppData\Local\npm-cache\_logs\2023-01-12T00_58_05_674Z-
> 25 verbose logfile
> C:\Users\ADMIN\AppData\Local\npm-cache\_logs\2023-01-12T00_58_05_674Z-debug-0.log
> 26 timing npm:load:logFile Completed in 15ms 27 timing npm:load:timers
> Completed in 0ms 28 timing npm:load:configScope Completed in 0ms 29
> timing npm:load Completed in 37ms 30 silly logfile done cleaning log
> files 31 timing config:load:flatten Completed in 1ms 32 info Running
> checkup 33 http fetch GET 200
> https://registry.npmjs.org/-/ping?write=true 453ms (cache miss) 34
> http fetch GET 200 https://registry.npmjs.org/npm 261ms (cache miss)
> 35 timing command:doctor Completed in 4395ms 36 verbose exit 0 37
> timing npm Completed in 4460ms 38 info ok
I applied the solutions that I mentioned and none of them solved the error. Does anyone know how I could solve it? Since I have not found any method to solve it

Yocto build failed with npm v8

Issue and Context
I'm currently migrating to Yocto Kirkstone and need some npm packages to be installed on the image.
I was using Dunfell previously which ships with npm v6, I could build it without issue.
But with Kirkstone (and npm v8) it fails during npm pack stating that a command could not be found.
Forcing NodeJs v14 with a custom recipe and defining PREFERRED_VERSION:nodejs work but I would like to stick to v16.
As an example, I will use the runmd package as the one I try to install has much more dependencies and I faced the same issue with runmd.
With this package the first command not found is husky.
What I tried
Generating a new .bb file with devtool add "npm://registry.npmjs.org;package=runmd;version=1.3.6"
=> same issue
Installing other packages
=> same issue
Running the command that fails with npm v6 from the host
=> it worked as before
Checked if the missing package is installed with npm list in the source directory (workspace/sources/runmd)
=> it wasn't
npm list | grep husky
├── UNMET DEPENDENCY husky#8.0.1
npm ERR! code ELSPROBLEMS
npm ERR! missing: husky#8.0.1, required by runmd#1.3.6
...
Forced the installation of husky by running npm install --legacy-peer-deps and run the same command again
=> it went a bit further but then failed by not finding husky in tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/npm-package this time (see logs)
Tried to force the --legacy-peer-deps in npm.bbclass as EXTRA_OENPM cannot be overwritten and NPM_INSTALL_DEV did not helped (I know, it's bad 😬)
=> still facing the issue
What I suspect
Seems like it has something to do with the new way npm handles dependencies but I can't figure out what to do/try next to fix it.
I'm not an Yocto nor npm v8 expert, so I might have overseen something.
Logs
NOTE: Executing Tasks
NOTE: runmd: compiling from external source tree /yocto/project/nuc-build/workspace/sources/runmd
ERROR: runmd-1.3.6-r0 do_compile: Error executing a python function in exec_func_python() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:npm_do_compile(d)
0003:
File: '/yocto/project/sources/poky/meta/classes/npm.bbclass', lineno: 262, function: npm_do_compile
0258: args.append(("target_arch", d.getVar("NPM_ARCH")))
0259: args.append(("build-from-source", "true"))
0260:
0261: # Pack and install the main package
*** 0262: tarball = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir)
0263: cmd = "npm install %s %s" % (shlex.quote(tarball), d.getVar("EXTRA_OENPM"))
0264: env.run(cmd, args=args)
0265:}
0266:
File: '/yocto/project/sources/poky/meta/classes/npm.bbclass', lineno: 67, function: npm_pack
0063: cmd = "npm pack %s" % shlex.quote(srcdir)
0064: args = [("ignore-scripts", "true")]
0065: print(cmd)
0066: print(args)
*** 0067: tarball = env.run(cmd, args=args, workdir=workdir).strip("\n")
0068: return os.path.join(workdir, tarball)
0069:
0070:python npm_do_configure() {
0071: """
File: '/yocto/project/sources/poky/bitbake/lib/bb/fetch2/npm.py', lineno: 126, function: run
0122: if args:
0123: for key, value in args:
0124: cmd += " --%s=%s" % (key, shlex.quote(value))
0125:
*** 0126: return _run(cmd)
0127:
0128:class Npm(FetchMethod):
0129: """Class to fetch a package from a npm registry"""
0130:
File: '/yocto/project/sources/poky/bitbake/lib/bb/fetch2/npm.py', lineno: 114, function: _run
0110:
0111: def _run(cmd):
0112: cmd = "NPM_CONFIG_USERCONFIG=%s " % (self.user_config.name) + cmd
0113: cmd = "NPM_CONFIG_GLOBALCONFIG=%s " % (self.global_config_name) + cmd
*** 0114: return runfetchcmd(cmd, d, workdir=workdir)
0115:
0116: if configs:
0117: bb.warn("Use of configs argument of NpmEnvironment.run() function"
0118: " is deprecated. Please use args argument instead.")
File: '/yocto/project/sources/poky/bitbake/lib/bb/fetch2/__init__.py', lineno: 929, function: runfetchcmd
0925: bb.utils.remove(f, True)
0926: except OSError:
0927: pass
0928:
*** 0929: raise FetchError(error_message)
0930:
0931: return output
0932:
0933:def check_network_access(d, info, url):
Exception: bb.fetch2.FetchError: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export PATH="/yocto/project/nuc-build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/bin/python3-native:/yocto/project/sources/poky/scripts:/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux:/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot/usr/bin/crossscripts:/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/sbin:/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/bin:/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/sbin:/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/bin:/yocto/project/sources/poky/bitbake/bin:/yocto/project/nuc-build/tmp/hosttools"; export HOME="/tmp/tmp8wc17ixl"; NPM_CONFIG_GLOBALCONFIG=/dev/null NPM_CONFIG_USERCONFIG=/tmp/tmpjceiejg8 npm pack /yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/npm-package --ignore-scripts=true failed with exit code 127, output:
npm verb cli [
npm verb cli '/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/bin/node',
npm verb cli '/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/bin/npm',
npm verb cli 'pack',
npm verb cli '/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/npm-package',
npm verb cli '--ignore-scripts=true'
npm verb cli ]
npm info using npm#8.5.0
npm info using node#v16.14.2
npm timing npm:load:whichnode Completed in 1ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/lib/node_modules/npm/npmrc Completed in 1ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 1ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:/tmp/tmpkm1z714f/.npmrc Completed in 0ms
npm timing config:load:project Completed in 1ms
npm verb config only Use `--omit=dev` to omit dev dependencies from the install.
npm timing config:load:file:/tmp/tmpjceiejg8 Completed in 2ms
npm timing config:load:user Completed in 2ms
npm timing config:load:file:/dev/null Completed in 1ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 1ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 0ms
npm timing config:load Completed in 10ms
npm timing npm:load:configload Completed in 10ms
npm timing npm:load:setTitle Completed in 1ms
npm timing config:load:flatten Completed in 2ms
npm timing npm:load:display Completed in 4ms
npm verb logfile /yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/npm-cache/_logs/2022-06-20T09_50_23_086Z-debug-0.log
npm timing npm:load:logFile Completed in 3ms
npm timing npm:load:timers Completed in 0ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 19ms
npm timing command:pack Completed in 16ms
npm verb stack Error: command failed
npm verb stack at ChildProcess.<anonymous> (/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/lib/node_modules/npm/node_modules/#npmcli/promise-spawn/index.js:64:27)
npm verb stack at ChildProcess.emit (node:events:526:28)
npm verb stack at maybeClose (node:internal/child_process:1092:16)
npm verb stack at Socket.<anonymous> (node:internal/child_process:451:11)
npm verb stack at Socket.emit (node:events:526:28)
npm verb stack at Pipe.<anonymous> (node:net:687:12)
npm verb pkgid runmd#1.3.6
npm verb cwd /tmp/tmpkm1z714f
npm verb Linux 5.13.0-1029-azure
npm verb argv "/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/bin/node" "/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/recipe-sysroot-native/usr/bin/npm" "pack" "/yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/npm-package" "--ignore-scripts=true"
npm verb node v16.14.2
npm verb npm v8.5.0
npm ERR! code 127
npm ERR! path /yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/npm-package
npm ERR! command failed
npm ERR! command sh -c husky install
npm ERR! sh: 1: husky: not found
npm verb exit 127
npm timing npm Completed in 132ms
npm verb code 127
npm ERR! A complete log of this run can be found in:
npm ERR! /yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/npm-cache/_logs/2022-06-20T09_50_23_086Z-debug-0.log
ERROR: Logfile of failure stored in: /yocto/project/nuc-build/tmp/work/corei7-64-poky-linux/runmd/1.3.6-r0/temp/log.do_compile.37326
ERROR: Task (/yocto/project/nuc-build/workspace/recipes/runmd/runmd_1.3.6.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1074 tasks of which 1067 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/yocto/project/nuc-build/workspace/recipes/runmd/runmd_1.3.6.bb:do_compile
Summary: There was 1 ERROR message, returning a non-zero exit code.
(The complete log referenced doesn't really help neither)
Thanks a lot in advance !
npm with kirkstone is broken; you can try patches from https://patchwork.yoctoproject.org/project/oe-core/list/?series=4303

How to properly run npm install scripts?

I'm trying to execute a Node.js script after my package is installed. But even testing with a simple echo command fails already.
Because I'm testing with local installation first, I've also tried the prepare script instead of install, but get the same results: no execution.
Suppose I have Package A (PA) that I want to install into Package B (PB).
PA's package.json script part looks like the following (tried install and prepare):
"install": "echo INSTALLED"
Installing it in PB like so:
npm install --save-dev ../package-a
But the echo, that should show something in console, seems to do nothing.
What do I oversee?
Update 1
Here's the verbose output of npm-install:
$ npm install --save-dev --loglevel verbose ../package-a/
npm verb cli [
npm verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '--save-dev',
npm verb cli '--loglevel',
npm verb cli 'verbose',
npm verb cli '../package-a/'
npm verb cli ]
npm info using npm#8.5.5
npm info using node#v16.14.2
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 5ms
npm timing config:load:file:C:\Users\User\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 2ms
npm timing config:load:builtin Completed in 2ms
npm timing config:load:cli Completed in 2ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:F:\public\npm\package-b\.npmrc Completed in 0ms
npm timing config:load:project Completed in 2ms
npm timing config:load:file:C:\Users\User\.npmrc Completed in 1ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:C:\Users\User\AppData\Roaming\npm\etc\npmrc Completed in 1ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:credentials Completed in 1ms
npm timing config:load:setEnvs Completed in 0ms
npm timing config:load Completed in 16ms
npm timing npm:load:configload Completed in 16ms
npm timing npm:load:setTitle Completed in 0ms
npm timing config:load:flatten Completed in 3ms
npm timing npm:load:display Completed in 7ms
npm verb logfile C:\Users\User\AppData\Local\npm-cache\_logs\2022-05-02T13_10_48_164Z-debug-0.log
npm timing npm:load:logFile Completed in 17ms
npm timing npm:load:timers Completed in 1ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 42ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 237ms
npm timing idealTree:userRequests Completed in 26ms
npm verb shrinkwrap failed to load node_modules/.package-lock.json missing from node_modules: ../package-c
npm timing idealTree:#root Completed in 16ms
npm timing idealTree:node_modules/package-a Completed in 0ms
npm timing idealTree:buildDeps Completed in 18ms
npm timing idealTree:fixDepFlags Completed in 3ms
npm timing idealTree Completed in 292ms
npm timing reify:loadTrees Completed in 560ms
npm timing reify:diffTrees Completed in 13ms
npm timing reify:retireShallow Completed in 0ms
npm timing reify:createSparse Completed in 3ms
npm timing reify:loadBundles Completed in 0ms
npm verb reify failed optional dependency F:\public\npm\package-b\node_modules\fsevents
npm timing reifyNode:node_modules/fsevents Completed in 21ms
npm timing reifyNode:node_modules/package-a Completed in 24ms
npm timing reify:unpack Completed in 24ms
npm timing reify:unretire Completed in 0ms
npm timing build:queue Completed in 0ms
npm timing build:deps Completed in 2ms
npm timing build:queue Completed in 1ms
npm timing build:links Completed in 1ms
npm timing build Completed in 4ms
npm timing reify:build Completed in 5ms
npm timing reify:trash Completed in 1ms
npm timing reify:save Completed in 64ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 422ms
npm timing auditReport:getReport Completed in 429ms
npm timing auditReport:init Completed in 0ms
npm timing reify:audit Completed in 430ms
npm timing reify Completed in 1015ms
added 1 package, and audited 480 packages in 1s
58 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npm timing command:install Completed in 1022ms
npm verb exit 0
npm timing npm Completed in 1383ms
npm info ok
Update 2
I've noticed I can run npm install . inside PA and my NPM script is executed. So the question here is: How do I get scripts executed if package is installed by another one?
Try naming your script postinstall, so the script runs automatically after issuing npm install:
"scripts": {
...
"postinstall": "echo INSTALLED"
}
Ok, I still don't understand why, but my solution to get it up and running is:
If using a local path:
Use prepare instead of install or postinstall
prepare seems to only execute if there is also an install script available in package.json.
install may not be empty. So an echo or such is at least required.
If using local *.tgz package use install instead (maybe just run prepare)
As said, I still don't know why it is working like that, because I always understood that behaviour a bit more different than it seems to be.
So further explanation of someone who knows why it only works like that is highly appreciated.

npm ERR! Cannot read properties of undefined (reading 'stdin')

I have an error when running vue.js 3 with vite
I added nodejs into Variable Environments before
I have tried these things but not working
using npm cache clear & npm cache clear --force but still error and receive npm WARN using --force Recommended protections disabled.
deleted node_modules folder and package.lock.json and run npm install
re-clone my repo on Github
re-installed Nodejs, VSCode, vite.js, update to latest npm
Debug log:
0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'run',
0 verbose cli 'dev'
0 verbose cli ]
1 info using npm#8.1.2
2 info using node#v17.1.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\Admin\Desktop\xfago-cms-vue\.npmrc Completed in 0ms
10 timing config:load:project Completed in 0ms
11 timing config:load:file:C:\Users\Admin\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Users\Admin\AppData\Roaming\npm\etc\npmrc Completed in 1ms
14 timing config:load:global Completed in 1ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 7ms
19 timing npm:load:configload Completed in 7ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 0ms
22 timing config:load:flatten Completed in 2ms
23 timing npm:load:cleanupLog Completed in 1ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 1ms
26 timing npm:load Completed in 12ms
27 timing command:run-script Completed in 7ms
28 verbose stack TypeError: Cannot read properties of undefined (reading 'stdin')
28 verbose stack at promiseSpawnUid (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:70:18)
28 verbose stack at promiseSpawn (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:15:10)
28 verbose stack at runScriptPkg (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\run-script\lib\run-script-pkg.js:54:13)
28 verbose stack at runScript (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\run-script\lib\run-script.js:9:16)
28 verbose stack at RunScript.run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:129:13)
29 verbose cwd C:\Users\Admin\Desktop\xfago-cms-vue
30 verbose Windows_NT 10.0.19043
31 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
32 verbose node v17.1.0
33 verbose npm v8.1.2
34 error Cannot read properties of undefined (reading 'stdin')
35 verbose exit 1```
The solution was to run the command npm init to create a "complete" package.json file.
same issue found to me beacuse i used
npm config --global set x = "Y"
so this is the huge mistake i did for that i need to unintall nodejs
and also delete C:/Users/"username"/Appdata/Roming/ delete npm from here as well,
again install it, it worked for me
i know this is not a solution but issue is according to me have only this solution.

NPM install hangs on stage:loadCurrentTree

I have a package on npm that links to git+ssh://git#bitbucket.org/own-repository/coreee.git#release-2.0
It hangs very often. Occasionally it will install fast, but more often i must wait like idk, 15 minutes before it started. It was stuck on this line:
⸨░░░░░░░░░░░░░░░░░░⸩ ⠧ rollbackFailedOptional: verb npm-session 353d0cde074aa46d
npm config list give me this:
; cli configs
metrics-registry = "http://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.9.0 node/v10.15.0 darwin x64"
; userconfig /Users/me/.npmrc
registry = "http://registry.npmjs.org/"
; node bin location = /Users/me/.nvm/versions/node/v10.15.0/bin/node
; cwd = /Users/me/Sites/own/website
; HOME = /Users/me
Log of my last npm install:
npm i coreee --verbose
npm info it worked if it ends with ok
npm verb cli [ '/Users/me/.nvm/versions/node/v10.15.0/bin/node',
npm verb cli '/Users/me/.nvm/versions/node/v10.15.0/bin/npm',
npm verb cli 'i',
npm verb cli 'coreee',
npm verb cli '--verbose' ]
npm info using npm#6.9.0
npm info using node#v10.15.0
npm verb npm-session f99560e8a75bc1cb
npm info lifecycle coreee#2.0.0~prepack: coreee#2.0.0
npm info lifecycle coreee#2.0.0~postpack: coreee#2.0.0
npm timing stage:loadCurrentTree Completed in **656301ms** <--- WTF!
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 25ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1529ms
npm http fetch GET 304 http://registry.npmjs.org/immutable 149ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/jss 163ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/hammerjs 181ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/axios 191ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/fbemitter 202ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/calendar-js 202ms (from cache)
npm http fetch GET 304 http://registry.npmjs.org/jss-camel-case 202ms (from cache)
...
...
npm http fetch GET 304 http://registry.npmjs.org/deep-diff 114ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 11518ms
npm timing stage:loadIdealTree Completed in 13695ms
npm timing stage:generateActionsToTake Completed in 131ms
npm verb correctMkdir /Users/me/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /Users/me/.npm/_locks/staging-63f53d125cff0e0c.lock for /Users/me/Sites/own/website/node_modules/.staging
npm timing audit submit Completed in 753ms
npm http fetch POST 200 http://registry.npmjs.org/-/npm/v1/security/audits/quick 753ms
npm timing audit body Completed in 2ms
npm timing action:extract Completed in 6750ms
npm info lifecycle coreee#2.0.0~preuninstall: coreee#2.0.0
npm info lifecycle coreee#2.0.0~uninstall: coreee#2.0.0
npm verb unbuild rmStuff coreee#2.0.0 from /Users/me/Sites/own/website/node_modules
npm info lifecycle coreee#2.0.0~postuninstall: coreee#2.0.0
npm timing action:unbuild Completed in 1ms
npm timing action:remove Completed in 144ms
npm timing action:finalize Completed in 4ms
npm timing action:refresh-package-json Completed in 6ms
npm info lifecycle coreee#2.0.0~preinstall: coreee#2.0.0
npm timing action:preinstall Completed in 0ms
npm info linkStuff coreee#2.0.0
npm timing action:build Completed in 1ms
npm info lifecycle coreee#2.0.0~install: coreee#2.0.0
npm timing action:install Completed in 1ms
npm info lifecycle coreee#2.0.0~postinstall: coreee#2.0.0
npm timing action:postinstall Completed in 0ms
npm verb unlock done using /Users/me/.npm/_locks/staging-63f53d125cff0e0c.lock for /Users/me/Sites/own/website/node_modules/.staging
npm timing stage:executeActions Completed in 6926ms
npm timing stage:rollbackFailedOptional Completed in 1ms
npm timing stage:runTopLevelLifecycles Completed in 677567ms
npm verb saving [ { name: 'coreee',
npm verb saving spec:
npm verb saving 'git+ssh://git#bitbucket.org/own/coreee.git#release-2.0',
npm verb saving save: 'dependencies' } ]
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN react-native-gesture-handler#1.3.0 requires a peer of react-native#>= 0.58.2 but none is installed. You must install peer dependencies yourself.
npm WARN react-apollo#2.5.6 requires a peer of apollo-client#beta but none is installed. You must install peer dependencies yourself.
+ coreee#2.0.0
updated 1 package and audited 37620 packages in **678.671s** <--- WTF!
found 30 vulnerabilities (7 low, 5 moderate, 18 high)
run `npm audit fix` to fix them, or `npm audit` for details
npm verb exit [ 0, true ]
npm timing npm Completed in 679103ms
npm info ok
I have done npm cache clean --force to no result.
I have deleted my package-lock.json to no result.
What could i possibly missed? Can anyone please help me?