Problem/Motivation

When I try to run npm install, I get the following error:

npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: joyride@https://github.com/zurb/joyride/archive/refs/heads/v2.1.tar.gz.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/daffie/.npm/_logs/2021-08-03T10_13_04_265Z-debug.log

The log gives the following errors:

1038 silly fetchPackageMetaData error for farbtastic@https://github.com/mattfarina/farbtastic/archive/1.3u.tar.gz Non-registry package missing package.json: farbtastic@https://github.com/mattfarina/farbtastic/archive/1.3u.tar.gz.

1081 silly fetchPackageMetaData error for joyride@https://github.com/zurb/joyride/archive/refs/heads/v2.1.tar.gz Non-registry package missing package.json: joyride@https://github.com/zurb/joyride/archive/refs/heads/v2.1.tar.gz.

1144 verbose stack Error: Non-registry package missing package.json: farbtastic@https://github.com/mattfarina/farbtastic/archive/1.3u.tar.gz.

1150 error code ENOPACKAGEJSON
1151 error package.json Non-registry package missing package.json: farbtastic@https://github.com/mattfarina/farbtastic/archive/1.3u.tar.gz.
1152 error package.json npm can't find a package.json file in your current directory.

In core/package.json both modules have their code hard linked.

"farbtastic": "https://github.com/mattfarina/farbtastic/archive/1.3u.tar.gz",
"joyride": "https://github.com/zurb/joyride/archive/refs/heads/v2.1.tar.gz",

The code was added in #3219088: Use package.json to manage third party JS libraries.

Proposed resolution

No idea

Remaining tasks

TBD

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

TBD

Comments

daffie created an issue. See original summary.

cilefen’s picture

Does the NPM version matter?

longwave’s picture

Drupal core uses yarn instead of npm for managing dependencies: https://www.drupal.org/about/core/policies/core-change-policies/frontend...

While npm would work (if it wasn't for this issue), we don't provide an npm lockfile so you always get the latest version of each dependency; we do provide a yarn.lock file so if you use yarn you get the same versions of dependencies that were used to build core.

nod_’s picture

Core uses yarn, so we didn't try with npm.

nod_’s picture

Category: Bug report » Support request
daffie’s picture

Status: Active » Closed (works as designed)

OK, I should have used yarn install instead of npm install.

@longwave, @nod_: Thank you for your replies!

uditrawat’s picture

I faced that issue with circle ci, I have used yarn install

npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: farbtastic@https://github.com/mattfarina/farbtastic/archive/1.3u.tar.gz.
npm ERR! package.json npm can't find a package.json file in your current directory.