You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When installing modules via git, pnpm doesn't run the build script (but npm does) resulting in misleading error messages such as "module not found" even though the module is there.
pnpm version:
7.19.0
Code to reproduce the issue:
pnpm init
pnpm add https://github.com/unjs/consola.git
node -r consola
node:internal/modules/cjs/loader:367
throw err;
^
Error: Cannot find module '/home/gv/wk/bdp/consola/t3/node_modules/consola/dist/consola.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:359:19)
at Module._findPath (node:internal/modules/cjs/loader:572:18)
at Module._resolveFilename (node:internal/modules/cjs/loader:932:27)
at Module._load (node:internal/modules/cjs/loader:787:27)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at Module._preloadModules (node:internal/modules/cjs/loader:1289:12)
at loadPreloadModules (node:internal/bootstrap/pre_execution:558:5)
at prepareMainThreadExecution (node:internal/bootstrap/pre_execution:95:3)
at node:internal/main/repl:19:1 {
code: 'MODULE_NOT_FOUND',
path: '/home/gv/wk/bdp/consola/t3/node_modules/consola/package.json',
requestPath: 'consola'
}
Node.js v18.4.0
>
Expected behavior:
npm init -y
npm add https://github.com/unjs/consola.git
node -r consola
Welcome to Node.js v18.4.0.
Type ".help" for more information.
>
Actual behavior:
See above.
Additional information:
node -v prints: v18.4.0
Windows, macOS, or Linux?: Linux
The text was updated successfully, but these errors were encountered:
Version v7.20.0 of pnpm introduced a change that makes it run our
publish script on install, breaking CI pipelines and local envs
alike.
See: pnpm/pnpm#5837
See: pnpm/pnpm#5826
See: https://github.com/pnpm/pnpm/releases/tag/v7.20.0
On environments where the pnpm store is cached, doing a second pnpm
install solves the issue. These doesn't work in envs like Docker tho.
Could be fixed by adding a `main` field to the top-level package.json
as version v7.22.0 added a check for that.
See: https://github.com/pnpm/pnpm/releases/tag/v7.22.0
See: pnpm/pnpm#5868
But since we are not really publishing these packages we can just
remove the script.
[f:2h]
When installing modules via git, pnpm doesn't run the
build
script (but npm does) resulting in misleading error messages such as "module not found" even though the module is there.pnpm version:
7.19.0
Code to reproduce the issue:
Expected behavior:
Actual behavior:
See above.
Additional information:
node -v
prints: v18.4.0Windows, macOS, or Linux?: Linux
The text was updated successfully, but these errors were encountered: