Nexus with NPM: Search will not work

792 views
Skip to first unread message

Sverre Moe

unread,
Feb 12, 2018, 7:34:20 AM2/12/18
to Nexus Users
I have set up our Nexus 3 with NPM repositories, but I cannot get search with npm to work.

Followed the setup guide from this blog post:
https://blog.sonatype.com/using-nexus-3-as-your-repository-part-2-npm-packages

Nexus is configured with npm-group, npm-inhouse, npm-registry and npm-yarn-registry.
npm-registry (proxy) => http://registry.npmjs.org
npm-yarn-registry (proxy) => https://registry.yarnpkg.com

cat ~/.npmrc
registry=http://nexus.company.com:8081/repository/npm-group/
_auth
=************************************


An older blog post showed how to set this up with the NPM command:

cat ~/.npmrc

I have tried with both of these slightly different npmrc configurations.


sverre@machine:~/workspace2/projectA> npm6 search kind
No match found for "kind"

Removing the registry from ~/.npmrc
sverre@machine:~/workspace2/projectA> npm6 search kind
npm WARN notice update to the newest npm client for improved search results: npmjs.com/get-npm
NAME                       DESCRIPTION                                                  AUTHOR              DATE       VERSION KEYWORDS
@konfirm/checksum          Calculate checksums on any kind of value, sorting keys for…  =rogier.spieker     2017-12-22 1.0.1


Running npm install works though:
sverre@machine:~/workspace2/projectA> npm6 install
/home/sverre/workspace2/projectA 
├─┬ ch...@1.1.3  
│ ├── ansi-...@2.2.1

sverre@machine:~/workspace2/projectA> npm6 list
/home/sverre/workspace2/
projectA 
├─┬ ch...@1.1.3
│ ├── ansi-...@2.2.1


After running npm install the Nexus NPM repository has now cached several packages

Peter Lynch

unread,
Feb 13, 2018, 8:06:31 AM2/13/18
to Sverre Moe, Nexus Users
On Mon, Feb 12, 2018 at 8:34 AM, Sverre Moe <sverr...@gmail.com> wrote:
I have set up our Nexus 3 with NPM repositories, but I cannot get search with npm to work.

Followed the setup guide from this blog post:
https://blog.sonatype.com/using-nexus-3-as-your-repository-part-2-npm-packages

Nexus is configured with npm-group, npm-inhouse, npm-registry and npm-yarn-registry.
npm-registry (proxy) => http://registry.npmjs.org
npm-yarn-registry (proxy) => https://registry.yarnpkg.com

cat ~/.npmrc
registry=http://nexus.company.com:8081/repository/npm-group/
_auth
=************************************


An older blog post showed how to set this up with the NPM command:

cat ~/.npmrc

I have tried with both of these slightly different npmrc configurations.


sverre@machine:~/workspace2/projectA> npm6 search kind
No match found for "kind"

Removing the registry from ~/.npmrc
sverre@machine:~/workspace2/projectA> npm6 search kind
npm WARN notice update to the newest npm client for improved search results: npmjs.com/get-npm

What npm version is this? ( npm --version ) Try upgrading to the latest npm client 4.x or 5.x / Node and Nexus 3.8.0 - latest versions of Nexus 3.7.0+ support the new search resource endpoint that recent npm versions require. This WARN from client suggests you are using an old npm client version that does not support this resource.

Make sure the npm-group contains at least the npm-registry ( proxy) as a member.

If there is still a problem after upgrading, use the -ddd option to npm client to help you debug what requests the client is making.

npm -ddd search kind

If there still isn't anything obvious, check your Nexus nexus.log for WARN or ERROR messages after the request.


NAME                       DESCRIPTION                                                  AUTHOR              DATE       VERSION KEYWORDS
@konfirm/checksum          Calculate checksums on any kind of value, sorting keys for…  =rogier.spieker     2017-12-22 1.0.1


Running npm install works though:
sverre@machine:~/workspace2/projectA> npm6 install
/home/sverre/workspace2/projectA 
├─┬ ch...@1.1.3  
│ ├── ansi-...@2.2.1

sverre@machine:~/workspace2/projectA> npm6 list
/home/sverre/workspace2/
projectA 
├─┬ ch...@1.1.3
│ ├── ansi-...@2.2.1


After running npm install the Nexus NPM repository has now cached several packages

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/e27c3dc9-15e3-4d10-b9f0-2ef4db8b4e06%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

Sverre Moe

unread,
Feb 13, 2018, 3:26:21 PM2/13/18
to Nexus Users, sverr...@gmail.com
tirsdag 13. februar 2018 14.06.31 UTC+1 skrev Peter Lynch følgende:

What npm version is this? ( npm --version ) Try upgrading to the latest npm client 4.x or 5.x / Node and Nexus 3.8.0 - latest versions of Nexus 3.7.0+ support the new search resource endpoint that recent npm versions require. This WARN from client suggests you are using an old npm client version that does not support this resource.

Make sure the npm-group contains at least the npm-registry ( proxy) as a member.
 
sverre@linuxm:~> npm --version
3.10.10

Running Nexus 3.8.0
Group npm-group contains both repositories of NPM registry I set up. Both NPM and YARN works fetching and cached packages in Nexus.

Running OpenSUSE Leap 42.3 on client which has installed npm6-6.12.2-6.1 and nodejs6-devel-6.12.2-6.1
I cannot find any packages which will give me a newer npm.

Peter Lynch

unread,
Feb 13, 2018, 4:30:55 PM2/13/18
to Sverre Moe, Nexus Users
On Tue, Feb 13, 2018 at 4:26 PM, Sverre Moe <sverr...@gmail.com> wrote:
tirsdag 13. februar 2018 14.06.31 UTC+1 skrev Peter Lynch følgende:

What npm version is this? ( npm --version ) Try upgrading to the latest npm client 4.x or 5.x / Node and Nexus 3.8.0 - latest versions of Nexus 3.7.0+ support the new search resource endpoint that recent npm versions require. This WARN from client suggests you are using an old npm client version that does not support this resource.

Make sure the npm-group contains at least the npm-registry ( proxy) as a member.
 
sverre@linuxm:~> npm --version
3.10.10


npm search will not work with that version as the REST resource it tries to use has been deprecated by npm maintainers due to performance concerns. Upgrade to npm client 4.x or 5.x latest versions is going to be required.

 
Running Nexus 3.8.0
Group npm-group contains both repositories of NPM registry I set up. Both NPM and YARN works fetching and cached packages in Nexus.

installing packages does not rely on the same requests that npm search makes. 

Some background:



Running OpenSUSE Leap 42.3 on client which has installed npm6-6.12.2-6.1 and nodejs6-devel-6.12.2-6.1
I cannot find any packages which will give me a newer npm.

Install from source? http://nodejs.org 

or install using npm itself?

npm -d install -g npm@4.6.1

 

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.

Sverre Moe

unread,
Feb 14, 2018, 4:26:37 AM2/14/18
to Nexus Users, sverr...@gmail.com


tirsdag 13. februar 2018 22.30.55 UTC+1 skrev Peter Lynch følgende:
On Tue, Feb 13, 2018 at 4:26 PM, Sverre Moe <sverr...@gmail.com> wrote:
tirsdag 13. februar 2018 14.06.31 UTC+1 skrev Peter Lynch følgende:

What npm version is this? ( npm --version ) Try upgrading to the latest npm client 4.x or 5.x / Node and Nexus 3.8.0 - latest versions of Nexus 3.7.0+ support the new search resource endpoint that recent npm versions require. This WARN from client suggests you are using an old npm client version that does not support this resource.

Make sure the npm-group contains at least the npm-registry ( proxy) as a member.
 
sverre@linuxm:~> npm --version
3.10.10


Running OpenSUSE Leap 42.3 on client which has installed npm6-6.12.2-6.1 and nodejs6-devel-6.12.2-6.1
I cannot find any packages which will give me a newer npm.

Install from source? http://nodejs.org 

or install using npm itself?

npm -d install -g npm@4.6.1

    

I upgraded NPM and search now works with Nexus as registry.
I went with the npm 5.6.0 version though.
npm -d install -g npm@5.6.0

/Sverre
Reply all
Reply to author
Forward
0 new messages