Meteor 1.3 mup deploy with npm packages - meteor

Since Meteor 1.3 came out I've been absolutely loving the new npm packages support!
I've been running mup successfully, however when I upgraded to 1.3 and added some npm packages, I get an error when running mup deploy.
[server]=> Starting meteor app on port:3000
[server]
[server]/bundle/bundle/programs/server/node_modules/fibers/fibers.js:16
[server] throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-fibe
[server] ^
[server]Error: `/bundle/bundle/programs/server/node_modules/fibers/bin/linux-x64-v8-3.14/fibers.node` is missing. Try reinstalling `node-fibers`?
[server] at Object.<anonymous> (/bundle/bundle/programs/server/node_modules/fibers/fibers.js:16:8)
[server] at Module._compile (module.js:456:26)
[server] at Object.Module._extensions..js (module.js:474:10)
[server] at Module.load (module.js:356:32)
[server] at Function.Module._load (module.js:312:12)
[server] at Module.require (module.js:364:17)
[server] at require (module.js:380:17)
[server] at Object.<anonymous> (/bundle/bundle/programs/server/boot.js:1:75)
[server] at Module._compile (module.js:456:26)
[server] at Object.Module._extensions..js (module.js:474:10)
I am pretty certain this is because I don't have the modules I used in development installed on the server. Is there any way I can tell mup, or the docker container it makes, "hey, my project depends on these packages, install them to my project directory before you execute node.js!"

Welp figured it out. So basically you need to run npm init! This will create a package.json file for you! That's what you need and it tells the server what dependancies your project has.

Related

Running pnpm lint-fix on a nextjs repository

I have a pull request in with the nextjs project here:
https://github.com/vercel/next.js/pull/45238
To get it accepted, I need to run pnpm lint-fix on the code.
I am utterly unfamiliar with pnpm and Python, but I got the latter installed correctly and then the former. I ran pnpm install and I then ran pnpm install lint-fix
It all installed. Or at least it appeared to do so.
Then, I try to run pnpm lint-fix and the result is:
PS C:\code\next.js\examples\auth-passage-passwordless> pnpm lint-fix
Error: Module build failed: TypeError: /home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/lib/bin.js: Duplicate declaration "b" (This is an error on an internal node. Probably an internal error.)
at File.buildCodeFrameError (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/lib/transformation/file/file.js:209:12)
at Scope.checkBlockScopedCollisions (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/scope/index.js:303:27)
at Scope.registerBinding (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/scope/index.js:485:16)
at Scope.registerDeclaration (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/scope/index.js:404:14)
at Object.BlockScoped (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/scope/index.js:146:28)
at Object.newFn (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/visitors.js:266:17)
at NodePath._call (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/path/context.js:64:19)
at NodePath.call (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/path/context.js:34:14)
at NodePath.visit (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/path/context.js:99:12)
at TraversalContext.visitQueue (/home/gitlab-runner/builds/8a39c300/0/pr/lint-fix/node_modules/#babel/core/node_modules/#babel/traverse/lib/context.js:139:18)
at Object. (C:\code\next.js\examples\auth-passage-passwordless\node_modules\lint-fix\dist\bin.js:71:7)
at webpack_require (C:\code\next.js\examples\auth-passage-passwordless\node_modules\lint-fix\dist\bin.js:21:30)
at C:\code\next.js\examples\auth-passage-passwordless\node_modules\lint-fix\dist\bin.js:64:18
at Object. (C:\code\next.js\examples\auth-passage-passwordless\node_modules\lint-fix\dist\bin.js:67:10)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
I have Googled until my fingers bled, but came across nothing of help.
How do I get lint-fix up and running?

Nextjs next-authjs production issue client_fetch_error invalid json response body at http://127.0.0.1:3000/api/auth/session

I have implemented Nextjs next-authjs with google.
On production i am facing this issue.
umesh.bhat#mcs:/var/mcs/test/gui-mcs-front-end$ npm run dev
> mcs-front-end#1.1.0 dev /var/mcs/test/gui-mcs-front-end
> next
SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/var/mcs/test/gui-mcs-front-end/node_modules/openid-client/lib/index.js:1:16)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
error - /var/mcs/test/gui-mcs-front-end/node_modules/openid-client/lib/issuer.js:32
#metadata;
I think the issue is related to NEXTAUTH_URL in env but i am not able to resolve that issue.

Cloudflare and next.js static exports not working?

It normally works but suddenly it stoped working and im not sure
why. If you can help thanks!
logs
2022-11-24T13:14:56.98176Z Executing user command: next build && next export
2022-11-24T13:14:57.075259Z /opt/buildhome/repo/node_modules/next/dist/build/index.js:344
2022-11-24T13:14:57.075558Z ...pageKeys.app ?? [],
2022-11-24T13:14:57.075709Z ^
2022-11-24T13:14:57.075852Z
2022-11-24T13:14:57.075978Z SyntaxError: Unexpected token '?'
2022-11-24T13:14:57.076087Z at wrapSafe (internal/modules/cjs/loader.js:1054:16)
2022-11-24T13:14:57.076193Z at Module._compile (internal/modules/cjs/loader.js:1102:27)
2022-11-24T13:14:57.0763Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
2022-11-24T13:14:57.076409Z at Module.load (internal/modules/cjs/loader.js:986:32)
2022-11-24T13:14:57.076516Z at Function.Module._load (internal/modules/cjs/loader.js:879:14)
2022-11-24T13:14:57.076621Z at Module.require (internal/modules/cjs/loader.js:1026:19)
2022-11-24T13:14:57.076736Z at require (internal/modules/cjs/helpers.js:72:18)
2022-11-24T13:14:57.076877Z at Object.<anonymous> (/opt/buildhome/repo/node_modules/next/dist/cli/next-build.js:10:37)
2022-11-24T13:14:57.077002Z at Module._compile (internal/modules/cjs/loader.js:1138:30)
2022-11-24T13:14:57.077111Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
2022-11-24T13:14:57.082209Z Failed: build command exited with code: 1
2022-11-24T13:14:57.927713Z Failed: an internal error occurred
It exports the files and deploys to cloud flare
The error you are getting indicates that your Node version does not support the nullish coalescing operator, which is part of Node as of version 14.
From reading the Cloudflare docs I understand that the default Node version is 12, which would match this suspicion.
The solution then would be to update your Cloudflare configuration to use a newer version (14+) of Node (see docs).

grunt generate-sources is failing with 'cannot find modules' and syntax error

Hi All,
We are facing an issue with mvn install where grunt generate-sources is failing with 'cannot find modules' error, for example it says node modules findup-sync, ini, has...etc, if we install these node modules separately there are some other modules which are missing and throwing below errors
**module not found error**:
Executing command line: /appserver/jenkins/workspace/project/./node_modules/.bin/grunt generate-sources --verbose
module.js:478
throw err;
Error: Cannot find module 'findup-sync'
at Function.Module./_resolveFilename (module.js:476:15)
at Function.Module./_load (module.js:424:25)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object./ (/appserver/jenkins/workspace/project/node_modules/grunt-cli/bin/grunt:8:14)
at Module./_compile (module.js:577:32)
at Object.Module./_extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module./_load (module.js:445:3)
**Syntax error**:
Executing command line: grunt.cmd generate-sources --verbose
C:/Users/AppData/Roaming/nvm/v6.14.4/node_modules/npm/node_modules/grunt-cli/node_modules/micromatch/index.js:44
let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (C:/Users/AppData/Roaming/nvm/v6.14.4/node_modules/npm/node_modules/grunt-cli/node_modules/findup-sync/index.js:12:10)
The same build was working last month without any changes to code and configuration, but now it's failing with the above mentioned errors, below are the version details
npm#3.10.10
node#v6.14.4
Could you please let me know what might cause this issue and how to resolve, thanks a lot in advance!
I have tried below steps:
Tried with different node versions 6.14.4, 6.17.1, 10.13.0
Tried with different grunt-cli versions 0.1.13, 1.0.2, 1.4.2, when we are running with different grunt cli versions we are seeing different node modules are missing
Tried removing node modules and install again
Tried installing missing node modules, if we install one, then it's giving some other module is missing
npm install findup-sync -g
npm link findup-sync
npm install grunt-cli -g

Meteor. Cannot find module 'request'

When I try to give new commands I get errors.
[root#localhost ~]# meteor
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'request'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object.<anonymous> (/usr/lib/meteor/app/meteor/deploy.js:9:15)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:32)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
This is because the node_modules are missing or the NODE_PATH is set incorrectly.
Try re-installing or debugging this, or try to create a dev_bundle instead from a git clone if the normal approach doesn't work for you...

Resources