Artifactory npm publish failed PUT 404 - json

I am trying to publish scoped npm packages to artifactory and I get the following error:
npm ERR! registry error parsing json
npm ERR! publish Failed PUT 404
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/Cellar/node4-lts/4.6.2/bin/node" "/usr/local/bin/npm" "publish"
npm ERR! node v4.6.2
npm ERR! npm v2.15.9
npm ERR! Unexpected token <
npm ERR! <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
npm ERR! <html><head>
npm ERR! <title>404 Not Found</title>
npm ERR! </head><body>
npm ERR! <h1>Not Found</h1>
npm ERR! <p>The requested URL /artifactory/api/npm/npm-local/#acres/acresmetajs was not found on this server.</p>
npm ERR! <hr>
npm ERR! <address>Apache/2.2.31 (Amazon) Server at artifacts.company.com Port 80</address>
npm ERR! </body></html>
I have set up my .npmrc file the following way:
registry=http://artifacts.company.com/artifactory/api/npm/npm-local/
_auth="mypassword"
always-auth=true
email=d.griner#company.com
#acres:registry=http://artifacts.company.com/artifactory/api/npm/npm-local/
//artifacts.company.com/artifactory/api/npm/npm-local/:_password=mypassword
//artifacts.company.com/artifactory/api/npm/npm-local/:username=myusername
//artifacts.company.com/artifactory/api/npm/npm-local/:email=d.griner#company.com
//artifacts.company.com/artifactory/api/npm/npm-local/:always-auth=true
I run npm publish and npm publish --registry http://artifacts.company.com/artifactory/api/npm/npm-local/ and get this same error. What am I missing?

I've found there are a couple more steps for getting scoped packages to work with artifactory if it's behind maven. https://techblog.dorogin.com/setting-up-artifactory-as-npm-repository-behind-apache-7541d5140492#.z0q412z5j
Essentially:
AllowEncodedSlashed set to NoDecode (by default it’s Off)
Added keyword nocanon for ProxyPass, it tells mod_proxy module not to canonicalize URLs

I got this on version 6.5.0. And the solution was remove "engines" group from in package.json.
npm ERR! publish Failed PUT 404
npm ERR! code E404
npm ERR! 404 NotFound The package 'xxxxxxxx' was not found in feed 'npmjs': xxxxxxxx
npm ERR! 404
npm ERR! 404 'xxxxxxxx' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Related

How to solve one errror installing an Angular Template ngx-admin

I want to use ngx-admin template for my project, I followed the instructions to install into angular 14 and I get these errors
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ngx-admin#8.0.0
npm ERR! Found: #angular/common#12.2.16
npm ERR! node_modules/#angular/common
npm ERR! #angular/common#"^12.2.16" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #angular/common#"^10.0.4" from ng2-ckeditor#1.2.9
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\HP Spectre X360 G1\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP Spectre X360 G1\AppData\Local\npm-cache\_logs\2022-07-23T03_56_45_643Z-debug-0.log
PS C:\dev\Angular\proyectos\09-ngx-admin>

Problems to install Mocha: "Error Parsing Json"

I have a problem installing mocha. I try to install mocha with the following line:
npm install -g mocha
This is the output which I get (If I type the http://registry.npmjs.org/mocha into the browser I'm able to see the json data):
npm http GET http://registry.npmjs.org/mocha
npm http 404 http://registry.npmjs.org/mocha
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
npm ERR! <html><head>
npm ERR! <title>404 Not Found</title>
npm ERR! </head><body>
npm ERR! <h1>Not Found</h1>
npm ERR! <p>The requested URL /mocha was not found on this server.</p>
npm ERR! </body></html>
npm ERR!
npm ERR! at Object.parse (native)
npm ERR! at RegClient.<anonymous> (C:\Program Files\nodejs\node_modules\npm\
node_modules\npm-registry-client\lib\request.js:203:23)
npm ERR! at Request.self.callback (C:\Program Files\nodejs\node_modules\npm\
node_modules\request\request.js:123:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\no
de_modules\request\request.js:893:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage.<anonymous> (C:\Program Files\nodejs\node_module
s\npm\node_modules\request\request.js:844:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "mocha"
npm ERR! cwd C:\Users\myName
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! type unexpected_token
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\myName\npm-debug.log
npm ERR! not ok code 0
After hours trying to resolve this issue I found this solution:
The problem which I had is connected to the proxy settings of npm. Which means that npm was not able to load the json file correctly.
You have to set the proxy settings first:
npm config set proxy http://username:password#YourProxy:Port
npm config set https-proxy https://username:password#YourProxy:Port (If you have one)

npm init not creating package.json on my mac

When I try to create a package.json file using npm init I keep getting the following:
npm http GET https://registry.npmjs.org/init
npm http 304 https://registry.npmjs.org/init
npm http GET https://registry.npmjs.org/daemon
npm http 304 https://registry.npmjs.org/daemon
init#0.1.2 node_modules/init
└── daemon#1.1.0
What is wrong? I have looked everywhere and I cannot find an answer.
Here is what I get when I run the following command:
Amens-Mac-mini:~ amenmojara$ npm init =ddd
npm http GET https://registry.npmjs.org/%3Dddd
npm http GET https://registry.npmjs.org/init
npm http 304 https://registry.npmjs.org/init
npm http 404 https://registry.npmjs.org/%3Dddd
npm ERR! 404 '%3Dddd' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.26/bin/node" "/usr/local/bin/npm" "install" "init" "=ddd"
npm ERR! cwd /Users/amenmojara
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/amenmojara/npm-debug.log
npm ERR! not ok code 0
Try this.
Go to terminal.
Change directory location where you want to create a file.
cd your_destination_folder
Type npm init and press enter.
It ask for name, version, description, entry point, test command, git repository, keywords, author, license. Pass those values.
Then it prompt, Is this ok? (yes). Enter yes.
Hurray, your package.json file is created.
You are doing npm install init instead of npm init. Just check if your npm <something> is not aliased to npm install <something>

connect mySQL with Nodejs

i am trying to install mysql Driver for Node.js
but i am getting below error .
can some one will help me ?
Thanks in Advance :)
C:\tmp\node>npm install mysql
npm http GET http://registry.npmjs.org/mysql
npm http GET http://registry.npmjs.org/mysql
npm http GET http://registry.npmjs.org/mysql
npm ERR! network getaddrinfo ENOTFOUND
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! System Windows_NT 5.1.2600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "mysql"
npm ERR! cwd C:\tmp\node
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5`enter code here`
npm ERR! syscall getaddrinfo
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\tmp\node\npm-debug.log
npm ERR! not ok code 0
Error is not strictly connected to mysql module.
Probably you are behind the proxy, try to follow the instruction how to setup npm behind the proxy here:
http://jjasonclark.com/how-to-setup-node-behind-web-proxy

npm package build failing, how best to debug?

I'm trying to install a mysql node package on Mac OS X. I'm trying to run a client project locally.
I have node and npm installed already and they work fine, other packages have installed fine. I've also compiled/installed the full LAMP stack.
When the build below fails, I'm not seeing any error messages that are helpful - just information about a library not being found. Without knowing what it can't find, I can't fix it.
Any advice? MySQL has been installed the standard way - downloaded packages, ./configure'd, make/install.
$ npm install mysql-libmysqlclient
npm http GET https://registry.npmjs.org/mysql-libmysqlclient
npm http 304 https://registry.npmjs.org/mysql-libmysqlclient
> mysql-libmysqlclient#1.3.3 install /Users/botskonet/node_modules/mysql-libmysqlclient
> node-gyp rebuild
info it worked if it ends with ok
spawn python [ '/Users/botskonet/.node-gyp/0.6.12/tools/gyp_addon',
'binding.gyp',
'-I/Users/botskonet/node_modules/mysql-libmysqlclient/build/config.gypi',
'-f',
'make' ]
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings.o
CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings_connection.o
CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings_result.o
CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings_statement.o
SOLINK_MODULE(target) Release/mysql_bindings.node
ld: library not found for -lmysqlclient_r
collect2: ld returned 1 exit status
make: *** [Release/mysql_bindings.node] Error 1
ERR! Error: `make` failed with exit code: 2
at Array.0 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:176:25)
at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok
npm ERR! mysql-libmysqlclient#1.3.3 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the mysql-libmysqlclient#1.3.3 install script.
npm ERR! This is most likely a problem with the mysql-libmysqlclient package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls mysql-libmysqlclient
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Darwin 11.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "mysql-libmysqlclient"
npm ERR! cwd /Users/botskonet/Sites/SportsBuddies
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.15
npm ERR! code ELIFECYCLE
npm ERR! message mysql-libmysqlclient#1.3.3 install: `node-gyp rebuild`
npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/botskonet/Sites/SportsBuddies/npm-debug.log
npm not ok
Look at the dependencies section in README and issues #107. To build mysql-libmysqlclient you should install both libmysqlclient and development headers for it, add path to your MySQL bin dir to $PATH and path to your MySQL lib dir to $DYLD_LIBRARY_PATH.