Kadira/mup.js Error: Cannot find module 'fbjs/lib/invariant' - javascript

$ npm -v
3.10.3
$ node -v
v4.5.0
I tried to setup mup.js from kadirahq/mup but after
cd .deploy
mup setup
I don't get any status of whether it setup properly or not, just returns next line as opposed to mupx setup which did provide SUCCESS MUPX setup messages along the way.
Can anyone provide actual real example of a working mup.js that is deployed to their own self hosting (no digital ocean examples etc) please as I already did that.
a working mup.js that has real mongo_url, mongo_oplog, root_url because I have tried but none successful yet.
EDIT:
Mac OSX
Meteor 1.4.1.1
Added example of mysparkapp/.deploy/mup.js:
module.exports = {
servers: {
one: {
host: 'IP address',
username: 'root',
password: 'xxxxxx!'
//pem: "/Users/seb/.ssh/id_rsa"
// or leave blank for authenticate from ssh-agent
}
},
meteor: {
name: 'myappdemo',
//path: '..',
path: '/Users/seb/myappdemo/',
docker: {
image: 'abernix/meteord:base'
},
servers: {
one: {}
},
buildOptions: {
serverOnly: true
},
env: {
PORT: 63830,
ROOT_URL: 'http://localhost:63830',
MONGO_URL: 'mongodb://localhost/meteor'
},
//dockerImage: 'kadirahq/meteord'
dockerImage: 'abernix/meteord:base',
deployCheckWaitTime: 60
},
mongo: {
oplog: true,
port: 27017,
servers: {
one: {},
},
},
};
then
$ mup setup
Started TaskList: Setup Docker
[138.68.141.215] - setup docker
[138.68.141.215] - setup docker: SUCCESS
Started TaskList: Setup Meteor
[138.68.141.215] - Setup Environment
Started TaskList: Setup Mongo
[138.68.141.215] - setup environment
[138.68.141.215] - setup environment: SUCCESS
[138.68.141.215] - copying mongodb.conf
[138.68.141.215] - copying mongodb.conf: SUCCESS
[138.68.141.215] - Setup Environment: SUCCESS
Started TaskList: Start Mongo
[138.68.141.215] - start mongo
[138.68.141.215] - start mongo: SUCCESS
$ mup deploy
Building App Bundle Locally
Started TaskList: Pushing Meteor
[138.68.141.215] - Pushing Meteor App Bundle to The Server
[138.68.141.215] - Pushing Meteor App Bundle to The Server: SUCCESS
[138.68.141.215] - Pushing the Startup Script
[138.68.141.215] - Pushing the Startup Script: SUCCESS
Started TaskList: Configuring Meteor Environment Variables
[138.68.141.215] - Sending Environment Variables
[138.68.141.215] - Sending Environment Variables: SUCCESS
Started TaskList: Start Meteor
[138.68.141.215] - Start Meteor
[138.68.141.215] - Start Meteor: SUCCESS
[138.68.141.215] - Verifying Deployment
[138.68.141.215] x Verifying Deployment: FAILED
-----------------------------------STDERR-----------------------------------
: "1.2.8"
}
npm WARN meteor-dev-bundle#0.0.0 No description
npm WARN meteor-dev-bundle#0.0.0 No repository field.
npm WARN meteor-dev-bundle#0.0.0 No license field.
=> Starting meteor app on port:80
/bundle/bundle/programs/server/node_modules/fibers/future.js:280
throw(ex);
^
Error: Cannot find module 'fbjs/lib/invariant'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/bundle/bundle/programs/server/npm/node_modules/react/lib/PooledClass.js:16:17)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Module.Mp.load (/bundle/bundle/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/reify/node/runtime.js:16:23)
at Function.Module._load (module.js:300:12)
=> Redeploying previous version of the app
-----------------------------------STDOUT-----------------------------------
To see more logs type 'mup logs --tail=50'
-----------
Then
$ npm install invariant warning --save
x Verifying Deployment: FAILED
-----------------------------------STDERR---------------------------- -------
erm"
npm ERR! node v4.4.7
npm ERR! npm v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! meteor-dev-bundle#0.0.0 install: `node npm-rebuild.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor-dev-bundle#0.0.0 install script 'node npm-rebuild.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the meteor-dev-bundle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node npm-rebuild.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs meteor-dev-bundle
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls meteor-dev-bundle
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /bundle/bundle/programs/server/npm-debug.log
=> Redeploying previous version of the app
-----------------------------------STDOUT-----------------------------------
To see more logs type 'mup logs --tail=50'
----------------------------------------------------------------------------
But later Error: Cannot find module 'fbjs/lib/invariant' reappears again???
SOLUTION (for me anyway)
$npm install -g bcrypt-nodejs &&
$npm uninstall -g bcrypt

Make sure you use a full path to your apps location - /users//.. mup.js doesn't like ~/
Otherwise post an example of your mup.js and I'll let you know where you are going wrong.

Related

Node.js app not deploying correctly on Heroku

My repository: https://github.com/jacklemasters/tech-blog
The app works locally on my machine, but I cannot seem to figure out why it will not work on Heroku. I have attempted completely moving the code, a new repository, nothing seems to help.
Here are the error logs I am receiving from Heroku:
2021-10-04T14:32:52.833339+00:00 app[web.1]: npm ERR! tech-blog#1.0.0 start: node server.js
2021-10-04T14:32:52.833414+00:00 app[web.1]: npm ERR! Exit status 1
2021-10-04T14:32:52.833484+00:00 app[web.1]: npm ERR!
2021-10-04T14:32:52.833533+00:00 app[web.1]: npm ERR! Failed at the tech-blog#1.0.0 start script.
2021-10-04T14:32:52.833601+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-10-04T14:32:52.847732+00:00 app[web.1]:
2021-10-04T14:32:52.847831+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-10-04T14:32:52.847916+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-10-04T14_32_52_834Z-debug.log
2021-10-04T14:32:53.006395+00:00 heroku[web.1]: Process exited with status 1
2021-10-04T14:32:53.089213+00:00 heroku[web.1]: State changed from starting to crashed
edit: I understand it could be something with my packages, but on my side I see them as installed. Still at a loss!
You are using libraries that you didn't import into the package.json with npm.
Example: npm install express-session
Other thing that is wrong is to upload the .dotenv file to GitHub. Use the .gitignore to avoid it and configure the heroku envorinment variables. See more here: https://devcenter.heroku.com/articles/config-vars

I'm facing a problem with npm run serve ( vue js project )

I am getting an error when trying to run npm run serve.
At fist I tried to work with vue in laravel project and run the "npm run serve command".
After that I uninstalled vue as well as vue/cli and reinstall them again. Then i created new vue project in independent folder. But when I am trying to run server as -> npm run serve at I'm getting the same error as when i tried it in the laravel project.
I used below codes for installation:
npm run serve => the vue and laravel project
npm run dev => the laravel project
This is the error :
$ npm run serve
vue-1#0.1.0 serve P:\codes & projects\vue\Tutorials\vue-1
vue-cli-service serve
'projects\vue\Tutorials\vue-1\node_modules\.bin\' is not recognized as an intern
al or external command,
operable program or batch file.
internal/modules/cjs/loader.js:1032
throw err;
^
Error: Cannot find module 'P:\#vue\cli-service\bin\vue-cli-service.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js
:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-1#0.1.0 serve: vue-cli-service serve**
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-1#0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ahmad\AppData\Roaming\npm-cache\_logs\2020-09-13T16_12_03_
919Z-debug.log
And This is an image for the error in the bash terminal :
enter image description here

Unable to call npm run build using vue-cli in production

Expected Behavior
npm run build should create the production dist bundle that I can serve on a given machine
Current Behavior
Despite being able to build locally, whenever I try to run npm run build on an external resource (such as a Digital Ocean VM or Heroku machine), I receive the below error.
Failure Logs
root#nodejs-lazyq-dev:/var/www/html/Vue# npm run build
> vue-material-dashboard-pro#1.0.0 build /var/www/html/Vue
> vue-cli-service build
⠴ Building for production...
ERROR Failed to compile with 1 errors 09:29:00
error in ./src/assets/scss/_material-dashboard.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
#import "md/plugins/fullCalendar";
^
File to import not found or unreadable: md/plugins/fullCalendar.
in /var/www/html/Vue/src/assets/scss/_material-dashboard.scss (line 59, column 1)
at runLoaders (/var/www/html/Vue/node_modules/webpack/lib/NormalModule.js:286:20)
at /var/www/html/Vue/node_modules/loader-runner/lib/LoaderRunner.js:364:11
at /var/www/html/Vue/node_modules/loader-runner/lib/LoaderRunner.js:230:18
at context.callback (/var/www/html/Vue/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.asyncSassJobQueue.push [as callback] (/var/www/html/Vue/node_modules/sass-loader/lib/loader.js:55:13)
at Object.done [as callback] (/var/www/html/Vue/node_modules/neo-async/async.js:7974:18)
at options.error (/var/www/html/Vue/node_modules/node-sass/lib/index.js:294:32)
# ./src/material-dashboard.js 17:0-48
# ./src/main.js
# multi ./src/main.js
ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-material-dashboard-pro#1.0.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-material-dashboard-pro#1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-09-03T09_29_01_030Z-debug.log
Additionally, I have tried running npm rebuild node-sass, updated the material-dashboard.css file to include the underscore: _material-dashboard.css, passing --production in npm install --production, but am having no luck.
nodejs version: v8.11.4
npm version: v5.6.0
I've been trying to solve this for a few hours now but am not having any luck. I don't understand why it works locally but not when on another production machine.
This happens because of a spelling mistake (wrong case) in the import statement of this Vue UI library. The file is named "fullcalendar" while the import is called by "fullCalendar" (notice the capital "C"). When you fix this (make the capital "C" simple in the import statement) it will run the "npm run prod" command successfully. It should be noted that, for me, this did not occur in the windows environment for some reason, but only occurs in the Linux environment.

Why can I not build create-react-app on ec2?

I've been playing with create-react-app for a little bit now on my local machine. I also create a basic express app that I'm running on my ec2 instance and so I wanted to push my create-react-app based project onto the ec2 and serve the build. The two commands of interest are npm run start and npm run build.
Unfortunately when running npm start (i believe 'run' isn't necessary for the command actually) on the ec2, I get a ton of errors.
[ec2-user#ip-172-31-62-133 ab-site-2017-summer]$ npm start
> ab-site#0.1.0 start /home/ec2-user/ab-site-2017-summer
> react-scripts start
/home/ec2-user/ab-site-2017-summer/node_modules/react-scripts/scripts/start.js:33
const {
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ab-site#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ab-site#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ec2-user/.npm/_logs/2017-06-26T03_51_22_790Z-debug.log
note: that I did notice some problems when npm install'ing the node_modules for this project on the ec2. I'm also not 100% (as a non-web-dev) whether my fundamental approach here is correct. My goal is to build the dist asset with npm build and than point my express app to serve the index.html file for my domain's index route. My front-end, through react-router should handle all the UI and front-end routing from there.
Per the create-react-app README
, you'll need to have Node >= 6 installed on your EC2 instance in order to build and run the app (the poster is using Node 4.4.5).
The error you are seeing is that Node 4 doesn't know how to handle ES6 destructuring syntax, which wasn't introduced until Node 6.4.0 (see http://node.green).

Node.js npm install express failed to fetch from registry [duplicate]

This question already has answers here:
"message failed to fetch from registry" while trying to install any module
(15 answers)
Closed 8 years ago.
I am starting my first Node.js server. I am attempting to follow a tutorial in Node.js.
Having installed Node.js and executed npm install, the next instruction is to start the server by running node server.js which generates the following error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'express'
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> (/home/sisko/Desktop/ExerciseFiles/01/03/start/server.js:1:77)
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 Array.0 (module.js:479:10)
sisko#VirtualBox:~/Desktop/ExerciseFiles/01/03/start$
It seemed it needed a module called express so I looked around and found the npm install express command which should fix the issue. However, I get the following error:
sisko#VirtualBox:~/Desktop/ExerciseFiles/01/03/start$ npm install express
npm http GET https://registry.npmjs.org/express
npm ERR! Error: failed to fetch from registry: express
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1261:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /home/sisko/Desktop/ExerciseFiles/01/03/start/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.2.0-52-generic
npm ERR! command "node" "/usr/bin/npm" "install" "express"
npm ERR! cwd /home/sisko/Desktop/ExerciseFiles/01/03/start
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: express
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/sisko/Desktop/ExerciseFiles/01/03/start/npm-debug.log
npm not ok
Seems like it's a SSL certificate issue with the repository, because it worked with HTTP but not HTTPS.
For troubleshooting only
To troubleshoot, on a sandbox where you're okay running untrusted code, you can confirm this by trying the repository under HTTP this insecure hack: running npm config set registry http://registry.npmjs.org/ (or whaterver repo) then npm install express.
If that worked when the HTTPS doesn't, then it's probably an SSL issue.
Please do not use this insecure config as a fix. It's not a fix.
Installing from HTTP opens you up to running code from a malicious source.
The fix is to update node/npm versions and/or fix the SSL.
This helps as an alternative solution to accepted answer:
npm config set strict-ssl false
The problem with npm is that the default registry ssl certificate is not recognized properly.

Categories

Resources