ELOOP: too many symbolic links encountered - node.js

When trying to hit the command : npm install -g #angular/cli#6.1.1
Note:
I have Node.Js LTS 10.xx version, .Net Framework 4.7.2 Developer pack, and all necessary extensions in place.
Error thrown:
npm ERR! code ELOOP
npm ERR! syscall stat
npm ERR! path \\horofs**\users$\
npm ERR! errno -62
npm ERR! ELOOP: too many symbolic links encountered, stat '\\horofs06\users$\'
npm ERR! A complete log of this run can be found in:
npm ERR! \\horofs**\users$\W****\AppData\Roaming\npm-cache\_logs\2020-07-31T13_26_25_468Z-debug.log
The log states this:
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 '-g',
1 verbose cli '#angular/cli#6.1.1' ]
2 info using npm#6.14.6
3 info using node#v10.22.0
4 verbose npm-session 8b2e687260b66580
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/#angular%2fcli 282ms (from cache)
8 silly pacote version manifest for #angular/cli#6.1.1 fetched in 426ms
9 verbose stack Error: ELOOP: too many symbolic links encountered, stat '\\horofs**\users$\'
9 verbose stack at eloop (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:58:17)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:19:11)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
9 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
10 verbose cwd C:\Cqe\Periscope\src\Periscope\Endava.Periscope.Web
11 verbose Windows_NT 6.3.9600
12 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "#angular/cli#6.1.1"
13 verbose node v10.22.0
14 verbose npm v6.14.6
15 error code ELOOP
Please help me.

I met a similar issue and the log said as following,
error ELOOP: too many symbolic links encountered, chmod '/Users/myname/projects/my-electron-app/node_modules/electron/cli.js'
error ELOOP: too many symbolic links encountered, open '/Users/myname/projects/my-electron-app/node_modules/electron/npm-shrinkwrap.json'
When I checked my folder and found the folder electron link to itself, so it led to a never-ending loop.
lrwxr-xr-x 1 myname staff 8 Feb 20 11:42 electron# -> electron
I checked the size and directly removed the file, then used npm install electron again. It finally worked.
So please check the link, it looks that the file in your application links to itself too.
I doubt that it should be an issue about npm because npm tries to create a link before the file is actually downloaded.

You can judge for yourself below. The disappointing situation is that you may not be able to use NodeJS when your User data is stored in a folder with more than 2,000 subfolders.
Like you, my User folder is stored on a network drive instead of C:
In "readGlobalPackageData()," the value of self.where is passed to readPackageTree. In my case, self.where = "\[domain]\users$[office location][userID]\AppData\npm." Code in realpathCached() is backing out of that path and trying to read all subfolders as it goes. When it gets to "\[domain]\users$", the "ELOOP" error is logged because there's a max depth of 2000, and my company's Users folder has more than 25,000 subfolders.
Here are two possible solutions:
First, remove -g from the install command to make the install local to the folder for your new app. The downside is that if there's an update to one of the dependencies, you'll have to install it manually everywhere you didn't use -g. That can be good if an update contains breaking changes.
Second, and I don't recommend this solution, is to edit one of the installer files. The installer is reading all the ID folders in your User folder and it's only failing because an arbitrary limits was reached. If you increase the limit, the error should go away but you're also letting the script read all the user IDs on your network. Try this at your own risk.
Open this file:
C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js.
On line 18, "if (depth > 2000)," change 2000 to a number greater than the number of folders under your users$ (share) folder.

As answered by Classic Craig
You can judge for yourself below. The disappointing situation is that you may not be able to use NodeJS when your User data is stored in a folder with more than 2,000 subfolders. Like you, my User folder is stored on a network drive instead of C: In "readGlobalPackageData()," the value of self.where is passed to readPackageTree. In my case, self.where = "[domain]\users$[office location][userID]\AppData\npm." Code in realpathCached() is backing out of that path and trying to read all subfolders as it goes. When it gets to "[domain]\users$", the "ELOOP" error is logged because there's a max depth of 2000, and my company's Users folder has more than 25,000 subfolders.
I also cannot install Angular globally on my user folder on my company's mainframe. I work around this by installing it locally.
First I initialized the installation location with
npm init
and by going to the directory within the node_modules I accessed .bin folder
cd ../node_modules/.bin
The ng command can be run within the .bin folder. Then I used ng new to create a new project within the .bin folder. Then, I can use the
npm run ng <command>
here. So I can use the ng command within the project folder.

Related

Neither NPM nor GitBash are operational at the moment. How can that be solved?

I am new to GitBash and do not know how it functions within VisualStudio Code. The challenge that I am faced with is enabling React.js to operate within VSCode. As it stands, the error message below is what's being output at this time.
D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\node_modules\babel-jest (version: 27.2.4)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
2. Delete node_modules in your project folder.
3. Remove "babel-jest" from dependencies and/or devDependencies in the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
6. Check if D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\node_modules\babel-jest is outside your project directory.
For example, you might have accidentally installed something in your home folder.
7. Try running npm ls babel-jest in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed babel-jest.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! affiliate-marketing-project#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the affiliate-marketing-project#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Refined_Silver\AppData\Roaming\npm-cache\_logs\2021-10-12T16_55_33_704Z-debug.log
PS D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\affiliate-marketing-project>
I followed the instructions above, but to no avail. For starters, "babel-jest" did not exist within the dependencies section of my package.json.
Below is the message that I have been receiving, which is inside of the debug log for React within Visual Studio Code.
0 info it worked if it ends with ok
1 verbose cli [
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 'start'
1 verbose cli ]
2 info using npm#6.14.15
3 info using node#v14.18.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle affiliate-marketing-project#0.1.0~prestart: affiliate-marketing-project#0.1.0
6 info lifecycle affiliate-marketing-project#0.1.0~start: affiliate-marketing-project#0.1.0
7 verbose lifecycle affiliate-marketing-project#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle affiliate-marketing-project#0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\affiliate-marketing-project\node_modules\.bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Python39\Scripts\;C:\Python39\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\Git\cmd;C:\Ruby26-x64\bin;C:\Users\Refined_Silver\AppData\Local\Microsoft\WindowsApps;C:\Users\Refined_Silver\AppData\Local\Programs\Microsoft VS Code\bin;C:\ProgramData\Refined_Silver\GitHubDesktop\bin;C:\Users\Refined_Silver\AppData\Roaming\npm;C:\Users\Refined_Silver\AppData\Local\Yarn\bin
9 verbose lifecycle affiliate-marketing-project#0.1.0~start: CWD: D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\affiliate-marketing-project
10 silly lifecycle affiliate-marketing-project#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle affiliate-marketing-project#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle affiliate-marketing-project#0.1.0~start: Failed to exec start script
13 verbose stack Error: affiliate-marketing-project#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1058:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
14 verbose pkgid affiliate-marketing-project#0.1.0
15 verbose cwd D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\affiliate-marketing-project
16 verbose Windows_NT 10.0.19043
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v14.18.0
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error affiliate-marketing-project#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the affiliate-marketing-project#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I am not-at-all familiar with how to read what is happening within the NPM / GitBash start-up process. Everything was working fine until I installed GitBash. I would appreciate some assistance with how GitBash functions.
I would appreciate any insight as to how this can be solved. Thank you.
Have you followed step 6 and removed babel-jest in D:\_Dearest_Lord_God,_please_intuitively_reveal_the_things_that_used_to_baffle_me]\_Projects-React]\node_modules ?
react-scripts comes with babel-jest. It warns you about the conflicting installation up the tree.

Why does this error happen? "npm run dev missing script error"

I've been trying to follow the following tutorial:
https://github.com/digitsensitive/phaser3-typescript/blob/master/README.md
These are the steps that I had to follow
Prerequisites
Download and install npm with Node.js # https://nodejs.org/en
Installing
Select a folder, navigate to it, and clone this repository with this command-line:
git clone https://github.com/digitsensitive/phaser3-typescript.git
Install the dependencies with this command-line:
npm install
If you use yarn just replace npm with yarn
Building and Running
Perform a quick build (bundle.js) and start server:
npm run dev
I've never used node.js and npm before so I'm stumbling across some newbie mistakes. One error I get is that when I try to run npm run dev, Git bash returns the following error code:
npm ERR! missing script: dev
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 'run',
1 verbose cli 'dev' ]
2 info using npm#6.4.1
3 info using node#v10.15.3
4 verbose stack Error: missing script: dev
4 verbose stack at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:155:19)
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:63:5
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:115:5
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:418:5
4 verbose stack at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:373:45)
4 verbose stack at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:416:3)
4 verbose stack at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:160:5)
4 verbose stack at ReadFileContext. (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:332:20)
4 verbose stack at ReadFileContext.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
4 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:237:13)
5 verbose cwd C:\Users\Yassi\TEST
6 verbose Windows_NT 10.0.17134
I don't know what I should be adding to my package.json file to make this work. Could anyone help me with this please?
I made a package.json using init, but the tutorial doesn't state that I have to do this. I don't know why I should manually make a package.json file in the first place.
Your package.json is missing a "dev" key in the scripts section.
Or you are running the npm command from a wrong directory.
Please use a package.json from their project. I think this will work
From here:
https://github.com/digitsensitive/phaser3-typescript?files=1
Just add div in scripts object in your package.json file
as you see
"scripts": {
"start": "node ./bin/www",
"dev": "nodemon ./bin/www"
},
that's if you use nodemon package

Switching Node versions give me `Cannot read property 'resolve' of undefined` from npm

I use the n version manager and when I change the Node version to 11.10 NPM stops working.
$ n latest
node/11.10.1
$ npm i sinon
npm ERR! Cannot read property 'resolve' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /home/myuser/.npm/_logs/2019-03-04T22_12_54_458Z-debug.log
$ npm --version
6.7.0
If I change back to the previous version of Node - or any earlier version really, it starts working again.
The full output from the debug log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'i', 'sinon' ]
2 info using npm#6.7.0
3 info using node#v11.10.1
4 verbose npm-session d32761bbecba8a12
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for sinon#^7.2.7 Cannot read property 'resolve' of undefined
8 timing stage:rollbackFailedOptional Completed in 0ms
9 timing stage:runTopLevelLifecycles Completed in 73ms
10 verbose stack TypeError: Cannot read property 'resolve' of undefined
10 verbose stack at regFetch (/usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/index.js:76:23)
10 verbose stack at fetchPackument (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/packument.js:42:10)
10 verbose stack at packument (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/packument.js:20:10)
10 verbose stack at getManifest (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:22:10)
10 verbose stack at manifest (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:13:10)
10 verbose stack at Object.manifest (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/index.js:17:12)
10 verbose stack at Object.Fetcher#manifest [as manifest] (/usr/local/lib/node_modules/npm/node_modules/genfun/lib/genfun.js:15:38)
10 verbose stack at manifest (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/fetch.js:23:18)
10 verbose stack at pinflight (/usr/local/lib/node_modules/npm/node_modules/pacote/manifest.js:24:12)
10 verbose stack at /usr/local/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:29:24
10 verbose stack at Promise._execute (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/debuggability.js:313:9)
10 verbose stack at Promise._resolveFromExecutor (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:483:18)
10 verbose stack at new Promise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:79:10)
10 verbose stack at _inflight (/usr/local/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:28:25)
10 verbose stack at /usr/local/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:22:14
10 verbose stack at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
11 verbose cwd /tmp/foo
12 verbose Linux 4.15.0-34-generic
13 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "sinon"
14 verbose node v11.10.1
15 verbose npm v6.7.0
16 error Cannot read property 'resolve' of undefined
17 verbose exit [ 1, true ]
This seems to be a problem with n, or how it bundles NPM, for (only) version 11.10 of Node. Basically the global npm install is broken.
This is resolved if one uses n to revert to an earlier version of Node and NPM and downloads the same problematic release (6.7.0).
n 11.9
npm install -g npm#6.7
n 11.10
This seems to overwrite the existing cached, global download of NPM version 6.7.0 and fix the install. The fix persists to work, even after switching between Node versions, even though the npm command is reset to point to the default each time. This means that even if you do npm i npm#6.8 -g to do a global upgrade of npm it will be reset to 6.7 the next time you switch back and forth to Node 11.10.
Are you running a version of n older than v2.1.12? n was updated in v2.1.12 to remove the previous npm node_modules folder during installation, to avoid problems when layout and content of the npm modules folder changes between versions.
If you have installed n using npm then, short version:
npm install -g n
Long version:
https://github.com/tj/n/issues/508#issuecomment-423933394
https://stackoverflow.com/a/53985680/1082434

Getting Error 404 while running npm install create-react-app

Getting error 404 while running npm install create-react-app or npm install -g npm#latest.
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 'create-react-app' ]
2 info using npm#5.6.0
3 info using node#v8.11.3
4 verbose npm-session 1f3eafc1b2f09e93
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 404 http://registry.npmjs.org/create-react-app 66ms
8 silly fetchPackageMetaData error for create-react-app#latest 404 Not Found: create-react-app#latest
9 verbose stack Error: 404 Not Found: create-react-app#latest
9 verbose stack at fetch.then.res (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
9 verbose stack at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
9 verbose stack at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
9 verbose stack at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
9 verbose stack at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
9 verbose stack at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
9 verbose stack at Async._drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
9 verbose stack at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
9 verbose stack at Immediate.Async.drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
9 verbose stack at runCallback (timers.js:810:20)
9 verbose stack at tryOnImmediate (timers.js:768:5)
9 verbose stack at processImmediate [as _immediateCallback] (timers.js:745:5)
10 verbose cwd M:\Projects\TestApps\ReactApp
11 verbose Windows_NT 6.1.7601
12 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app"
13 verbose node v8.11.3
14 verbose npm v5.6.0
15 error code E404
16 error 404 Not Found: create-react-app#latest
17 verbose exit [ 1, true ]
First check if is a Proxy Issue.
Try to install the package with another internet connection!
Another causes
Missing repository registry
$ npm set registry https://registry.npmjs.org/
Clean cache
$ npm cache clean
$ npm rebuild
My problem also same but when I try following commands then works fine
If you've previously installed create-react-app globally via npm install -g create-react-app, I recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version.
Then reinstall using
npm install -g create-react-app
You have already installed the npm create-react-app globally. You can just write
npm init react-app *projectFolderName*
and it will work just fine.
I was having the same problem for almost a week here is my simple solution if you are using windows 1 run cmd as admin, 2 put this url 'npm config set registry https://skimdb.npmjs.com/registry' on cmd,3 then type 'npx create-react-app#latest YourProjectName'
The newest way to do this would be to use npx.
npx create-react-app my-app [...options]
I use this method because I also use nvm to manage node installs. Everything just plays nice with this method.
Try uninstalling the current version of npm and install the latest version using
npm install -g create-react-app
For me restarting my code editor did the job
You can try this command, which has worked for me:
npm config set strict-ssl false

npm audit EINVALIDTAGNAME

When I execute npm audit in a folder with the project's package.json and package-lock.json I get the following error:
0 info it worked if it ends with ok
1 verbose cli [ '/home/user/Downloads/node-v10.14.0-linux-x64/bin/node',
1 verbose cli '/home/user/Downloads/node-v10.14.0-linux-x64/bin/npm',
1 verbose cli 'audit' ]
2 info using npm#6.5.0
3 info using node#v10.14.0
4 verbose npm-session d5b5c65bd8e7ae03
5 verbose stack Error: Invalid tag name "[object Object]": Tags may not have any characters that encodeURIComponent encodes.
5 verbose stack at invalidTagName (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:87:15)
5 verbose stack at fromRegistry (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:290:13)
5 verbose stack at Function.resolve (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:77:12)
5 verbose stack at Object.keys.forEach.name (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/lock-verify/index.js:26:26)
5 verbose stack at Array.forEach (<anonymous>)
5 verbose stack at Promise.all.then.result (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/lock-verify/index.js:25:25)
6 verbose cwd /home/user/projects/test-npm/CRYPTOSTORAGE/repos/crypto-storage/etc/approvalClient
7 verbose Linux 3.10.0-862.14.4.el7.x86_64
8 verbose argv "/home/user/Downloads/node-v10.14.0-linux-x64/bin/node" "/home/user/Downloads/node-v10.14.0-linux-x64/bin/npm" "audit"
9 verbose node v10.14.0
10 verbose npm v6.5.0
11 error code EINVALIDTAGNAME
12 error Invalid tag name "[object Object]": Tags may not have any characters that encodeURIComponent encodes.
13 verbose exit [ 1, true ]
If this would happen to only one project - but actually it does indeed happen to all projects that I've tried (~70). There is an internal registry, but I've both removed the local .npmrc and the one in home. Also the error I was getting then was a different one.
Is this a bug or am I doing something wrong?
Not positive if this is the exact issue the author is hitting, but I ran into this error when I copy/pasted the contents of my package.json into package-lock.json. As I was searching through the JS stack trace, I realized that those files have different object formats and are not interchangeable.
This is likely your issue if npm install works fine, but npm ci and npm audit are failing with the above error.

Resources