-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cant find package json-server within node_modules #1557
Comments
Same issue as above +1 |
This issue began with version 1.0 (anything). I walked simple project
backwards thru all published packages. The one that worked was version
0.17.4.
…On Tue, Jun 4, 2024, 17:30 Bankole ***@***.***> wrote:
Same issue as above +1
—
Reply to this email directly, view it on GitHub
<#1557 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACFHJTBYRQAKRIG5462HH3ZFY5Y5AVCNFSM6AAAAABIYO7K7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBYGUYTKNRXGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
i think this is because the line:
which used to be in the package.json on and thus since this package has become no longer usable like that.
should be the fix for now, |
It would be nice if the maintainers had plans to allow it to run as an express middleware. In my case, I need to manipulate some header information that my app expects to see in server call results. |
PNPM and NPM are reporting that it cannot find json-server from import statement within calling server.js file.
server.js file
package.json file
The error:
ajackman@MarsVenus:~/projects/ep/crazy$ npm run start
node:internal/modules/esm/resolve:210
const resolvedOption = FSLegacyMainResolve(packageJsonUrlString, packageConfig.main, baseStringified);
^
Error: Cannot find package '/home/ajackman/projects/ep/crazy/node_modules/json-server/package.json' imported from /home/ajackman/projects/ep/crazy/server.js
at legacyMainResolve (node:internal/modules/esm/resolve:210:26)
at packageResolve (node:internal/modules/esm/resolve:828:14)
at moduleResolve (node:internal/modules/esm/resolve:914:18)
at defaultResolve (node:internal/modules/esm/resolve:1119:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:511:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v22.2.0
npm version 9.5.1
pnpm version 9.1.0
node version 22.2.0
WSL2 / Debian 11 (Guest) / Windows 11 (host)
The text was updated successfully, but these errors were encountered: