I have an app that is still at meteor 1.2 that I used to deploy to ubuntu 14.04 servers happily with mup. However, I have now moved the host server along to 16.04 and mup (as well as mupc) have stopped working.
The last time I deployed one of these apps I followed the procedure below and it worked fine.
apt install nodejs nodejs-legacy
install nvm
nvm install v0.10.40
Bundle the app on my dev box, and unpack it on the host
cd /app/programs/server
npm install
and I get
> fibers#1.0.5 install /opt/sapwfdashboard/programs/server/node_modules/fibers
> node ./build.js
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
internal/child_process.js:298
throw errnoException(err, 'spawn');
^
Error: spawn EACCES
at exports._errnoException (util.js:870:11)
at ChildProcess.spawn (internal/child_process.js:298:11)
at Object.exports.spawn (child_process.js:362:9)
at build (/opt/sapwfdashboard/programs/server/node_modules/fibers/build.js:55:5)
at Object.<anonymous> (/opt/sapwfdashboard/programs/server/node_modules/fibers/build.js:47:3)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
npm ERR! fibers#1.0.5 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers#1.0.5 install script.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.4.0-109-generic
npm ERR! command "/root/.nvm/v0.10.40/bin/node" "/root/.nvm/v0.10.40/bin/npm" "install"
npm ERR! cwd /opt/sapwfdashboard/programs/server
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
I'm stuck. Any idea how to get around this. I am going to have to upgrade this app as the initial deployments are just impossible now.
The best way I've found to deploy this is to use mupc to set up the instances, and then use the manual deployment process from there onwards.
I'm still to work out what the differences are.
Related
I have a node app that runs nicely from the command line with a npm start command
But when I start it from the crontab #reboot issues the following error:
> pepsr#1.0.104 start /home/debian/Desktop/devel/iot
> node pepsr.js
/home/debian/Desktop/devel/iot/pepsr.js:206
...config
^^^
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.runMain (module.js:611:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:160:9)
npm ERR! Linux 4.14.108-ti-r113
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v6.17.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! pepsr#1.0.104 start: `node pepsr.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pepsr#1.0.104 start script 'node pepsr.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 pepsr package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node pepsr.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pepsr
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pepsr
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/debian/Desktop/devel/iot/npm-debug.log
My cron tab is as follows:
#reboot sleep 180 && /home/debian/Desktop/devel/iot/pepsrRestartOnReboot.sh
pepsrRestartOnReboot.sh is as follows:
cd /home/debian/Desktop/devel/iot/
./pepsrStart.sh &
pepsrStart.sh is as follows:
cd /home/debian/Desktop/devel/iot/
nohup ./pepsrRestart.sh >> pepsr.log 2>&1
And pepsrRestart.sh is as follows:
npm start
Two version of node was installed.
What I did:
Uninstalled n:
$ sudo n uninstall
Installed node from the NodeSource:
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
Actually install node 12 lts:
sudo apt install nodejs
Check that I have what I want:
node -v
v12.22.0
I use webpack 4, sass, pug and bemto. Module on windows worked normal, but on Ubuntu:
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! node-sass#4.14.1 postinstall: `node scripts/build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the node-sass#4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I tried enter command:
sudo npm install -g --unsafe-perm node-sass
>
(node:8310) [DEP0139] DeprecationWarning: Calling process.umask() with no arguments is prone to race conditions and is a potential security vulnerability.
(Use `node --trace-deprecation ...` to show where the warning was created)
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
/usr/local/bin/node-sass -> /usr/local/lib/node_modules/node-sass/bin/node-sass
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2725/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> node-sass#4.14.1 install /usr/local/lib/node_modules/node-sass
> node scripts/install.js
Cached binary found at /root/.npm/node-sass/4.14.1/linux-x64-83_binding.node
> node-sass#4.14.1 postinstall /usr/local/lib/node_modules/node-sass
> node scripts/build.js
Binary found at /usr/local/lib/node_modules/node-sass/vendor/linux-x64-83/binding.node
Testing binary
/snap/node/2725/bin/node: symbol lookup error: /usr/local/lib/node_modules/node-sass/vendor/linux-x64-83/binding.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeEPKNS_9CFunctionE
npm WARN You are using a pre-release version of node and things may not work as expected
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! node-sass#4.14.1 postinstall: `node scripts/build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the node-sass#4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
UPD:
I tried:
npm uninstall node-sass
After:
npm install node-sass
Did not help.
I tried:
npm install node-gyp global, save, savedev
ERROR in ./src/sсss/critical.scss (./node_modules/css-loader??ref--5-1!./node_modules/sass-loader/lib/loader.js??ref--5-2!./src/sсss/critical.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Cannot find module 'node-sass'
Require stack:
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/sass-loader/lib/loader.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/loadLoader.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/LoaderRunner.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack/lib/NormalModule.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack/lib/NormalModuleFactory.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack/lib/Compiler.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack/lib/webpack.js
- /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/webpack-dev-server/bin/webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
at Function.Module._load (internal/modules/cjs/loader.js:890:27)
at Module.require (internal/modules/cjs/loader.js:1080:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/sass-loader/lib/loader.js:3:14)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
at Module.require (internal/modules/cjs/loader.js:1080:19)
at require (internal/modules/cjs/helpers.js:72:18)
at loadLoader (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/loadLoader.js:18:17)
at iteratePitchingLoaders (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
at iteratePitchingLoaders (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/LoaderRunner.js:165:10)
at /home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/LoaderRunner.js:176:18
at loadLoader (/home/gorevanova/Documents/WebStorm/webpack-static/node_modules/loader-runner/lib/loadLoader.js:47:3)
But problem don't leave me.
Run this commands:
rm -rf ./node_modules ./package-lock.json, then
npm cache verify.
PS: I recommend to install nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Also I don’t know if you already have it, but make sure to also have build-essential install
$ sudo apt update && apt install build-essential
It is a set of c++ compilers and Bunch of useful 💩
something else that I have seen is the lack of python 2.x.x
$ sudo apt install python
Try this, it worked for me
npm i --unsafe-perm node-sass
Please check your node version before install it, node-sass has striction about node versions, shown as below:
refer to https://github.com/sass/node-sass
Cached binary found at /root/.npm/node-sass/4.14.1/linux-x64-83_binding.node
Binary found at /usr/local/lib/node_modules/node-sass/vendor/linux-x64-83/binding.node
Testing binary
I would say the issue could be the fact it's using a cached version from before you upgraded to Ubuntu 20, in which case, removing the cached binary would resolve this.
https://docs.npmjs.com/cli-commands/cache.html
This is just my assumption, what have you tried so far to resolve this issue?
I am new to puppeteer and would appreciate as much help as possible.
My puppeteer tests build fails in travis ci. I am assuming the reason may be related to puppeteer's node_module. Any suggestion would be helpful.
There have been similar issues logged but with no solution provided. Here are some links of these issues:
https://github.com/GoogleChrome/puppeteer/issues/833
https://api.travis-ci.com/v3/job/124937719/log.txt
https://travis-ci.com/BME-MIT-IET/Hmmm-iet-2018/jobs/124938746
My system config:
Puppeteer version:1.8.0
Platform / OS version: Mac > High Sierra
Node.js version: v8.12.0
npm : 6.4.1
This is the error message:
puppeteer#1.8.0 install /www/vhosts//node_modules/puppeteer
node install.js
/www/vhosts/node_modules/puppeteer/install.js:61
.then(() => browserFetcher.localRevisions())
^
SyntaxError: Unexpected token )
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
npm ERR! puppeteer#1.8.0 install: node install.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the puppeteer#1.8.0 install script 'node install.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 puppeteer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs puppeteer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls puppeteer
npm ERR! There is likely additional logging output above.
From the Puppeteer documentation:
Puppeteer requires at least Node v6.4.0, but the examples below use async/await which is only supported in Node v7.6.0 or greater.
Your Travis configuration uses node v0.10.42 so you must upgrade it to atleast v6.4.0.
You can reference to Travis documentation on Specifying Node.js versions. Here is a minimal setup:
.travis.yml:
language: node_js
node_js:
- "iojs"
- "7"
I am working on google firebase functions to generate thumbnails for images using imagemagic, I did exactly what is mentioned in this link
and also I have gone through this link.
I am getting the following exception while deploying using gcloud app deploy command. I have gone through other SO posts(link) which are similar to this issue.
I also have updated firebase tools using (npm install -g firebase-tools). is anything else I am missing ?
In the exception is says
at Object. (/app/lib/functions.js:43:47) at line number 43 the code snippet looks like this
exports.generateThumbnail = functions.storage.object().onChange(event => {
Exception looks as follows
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
> nodejs-getting-started#1.0.0 start /app
> node app.js
/app/node_modules/firebase-functions/lib/config.js:51
throw new Error('Firebase config variables are not available. ' +
^
Error: Firebase config variables are not available. Please use the latest version of the Firebase CLI to deploy this function.
at init (/app/node_modules/firebase-functions/lib/config.js:51:15)
at Object.config (/app/node_modules/firebase-functions/lib/config.js:29:9)
at Object.object (/app/node_modules/firebase-functions/lib/providers/storage.js:41:27)
at Object.<anonymous> (/app/lib/functions.js:43:47)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! nodejs-getting-started#1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejs-getting-started#1.0.0 start script 'node app.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 nodejs-getting-started package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs nodejs-getting-started
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls nodejs-getting-started
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /app/npm-debug.log
I've just recently started to learn how to use the React framework and have been following the LevelUpTuts channel on youtube. In video 7 of their React playlist, they use this (I guess boilerplate) project called React-Starterify. He made it look easy installing it on his Mac, however I'm on windows and it is becoming a complete nightmare. Here is the project:
https://github.com/Granze/react-starterify
I've followed the exact steps, however when I do the whole "npm run watch".
> react-starterify#2.1.3 watch K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4
> gulp watch
[13:40:11] Requiring external module babel-core/register
K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\gulpfile.babel.js:108
var opts = Object.assign({}, _watchify2.default.args, customOpts);
^
TypeError: undefined is not a function
at Object.<anonymous> (gulpfile.babel.js:39:21)
at Module._compile (module.js:460:26)
at loader (K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\node_modules\babel-core\node_modules\babel-register\lib\node.js:130:5)
at Object.require.extensions.(anonymous function) [as .js] (K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\node_modules\babe
l-core\node_modules\babel-register\lib\node.js:140:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Liftoff.handleArguments (K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\node_modules\gulp\bin\gulp.js:116:3)
at Liftoff.<anonymous> (K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\node_modules\gulp\node_modules\liftoff\index.js:192:16)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! react-starterify#2.1.3 watch: `gulp watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-starterify#2.1.3 watch script 'gulp watch'.
npm ERR! This is most likely a problem with the react-starterify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp watch
npm ERR! You can get their info via:
npm ERR! npm owner ls react-starterify
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\npm-debug.log
I've tried updating gulp and babel, with the same results.
Gulp CLI and Local versions are 3.9.0.
I looks like it's complaining about something with Windows. Has anyone had any luck getting their Windows machine working with the project?
If not, can anyone recomment another starter project for React, for beginners?
I haven't used react-starterify, but I have used a site called http://www.overreact.io/ It allows you to draw out your components and then download all of your starter files including a server/gulp. I know for windows you would have to download the zip file, since the npm package doesn't work at the moment, but I have used the zip and it works. Hope that helps!