bug: global installation via pnpm cannot find modules
See original GitHub issueChoose one: ๐ bug report
๐ Configuration (.babelrc, package.json, cli command)
No babel configuration, itโs my first install and I just wanted to try it out.
๐ค Expected Behavior
Running parcel index.html should start the live server.
๐ฏ Current Behavior
Build fails with an error about missing modules. Running pnpm install -g posthtml-parser fixed the first one, but then it complains about posthtml-render.
๐จ Cannot find module 'posthtml-parser'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (/home/vortex/.nvm/versions/node/v8.3.0/pnpm-global/1/node_modules/.registry.npmjs.org/v8-compile-cache/1.1.0/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/home/vortex/.nvm/versions/node/v8.3.0/pnpm-global/1/node_modules/.registry.npmjs.org/parcel-bundler/1.4.0/node_modules/parcel-bundler/src/assets/HTMLAsset.js:2:15)
at Module._compile (/home/vortex/.nvm/versions/node/v8.3.0/pnpm-global/1/node_modules/.registry.npmjs.org/v8-compile-cache/1.1.0/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
๐ Possible Solution
it seems this is as a result of pnpm not flattening dependencies.
๐ฆ Context
๐ป Code Sample
๐ Your Environment
| Software | Version(s) |
|---|---|
| Parcel | 1.4.0 |
| Node | 8โฆ3.0 |
| pnpm | 1.25.1 |
| Operating System | Peppermint 8 Linux |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Module not found if installing a package in global with pnpm
I am trying to install prettier with pnpm install prettier -g , and when I ... Error: Cannot find module '/Users/hugosum/pnpm-global/5/ย ...
Read more >Installation | pnpm
You may install pnpm even if you don't have Node.js installed, using the ... Error: Cannot find module 'C:\Users\Bence\AppData\Roaming\npm\pnpm-global\4\ย ...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory โ npm install package-name or yarn...
Read more >pnpm/pnpm - Gitter
How do I debug node after using pnpm install? ... node:internal/modules/cjs/loader:944 throw err; ^ Error: Cannot find module ...
Read more >pnpm - npm
Fast, disk space efficient package manager. Latest version: 7.20.0, last published: 2 days ago. Start using pnpm in your project by runningย ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@yoanthiebault - itโs the same reason iโm seeing an error when
tap/bin/jack.jsattempt to loadtreport/typeson line 8. (tap v14.10.8).treport/typesis not declared as a dependency in package.json.Having the same issue. Modules that are direct dependencies should be listed as so in the
package.json.