error while creating a jhipster project on linux - jhipster

When I m running
sudo yo jhipster
, I m getting this error at the end of the creation process:
Error: EACCES, permission denied '/home/userxxx/.config/configstore/insight-yo.yml'
You don't have access to this file.
at Object.fs.openSync (evalmachine.<anonymous>:438:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:289:15)
at Object.create.all.get (/usr/lib/node_modules/yo/node_modules/configstore/configstore.js:33:29)
at Object.Configstore (/usr/lib/node_modules/yo/node_modules/configstore/configstore.js:26:44)
at new Insight (/usr/lib/node_modules/yo/node_modules/insight/lib/index.js:26:34)
at Object.<anonymous> (/usr/lib/node_modules/yo/cli.js:123:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
I have tried :
chown userxxx /home/userxxx/.config/configstore/insight-yo.yml
But this doesn't help.
If I m trying to create my project without sudo, it ends with :
npm ERR! Error: EACCES, mkdir '/home/userxxx/.npm/each-async/0.1.3'
npm ERR! { [Error: EACCES, mkdir '/home/userxxx/.npm/each-async/0.1.3']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/userxxx/.npm/each-async/0.1.3',
npm ERR! parent: 'grunt-svgmin' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.16.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/userxxx/dev/workspace/blankjhipster
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /home/userxxx/.npm/each-async/0.1.3
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/home/userxxx/.npm/each-async/0.1.3'
npm ERR! not ok code 0
it appears that the folder 01.1.3 doesn't exits, I have the folder 1.1.0
If anyone knows about this issue...
I m using ubuntu 14.10
Thanks in advance.

First of all, you don't need to use sudo with jhipster. Please try the following
Delete your existing ~/.npm cache using sudo for one last time: sudo rm -r /home/userxxx/.npm
This was the last time to use sudo for this task, all the following commands should be run as user userxxx without sudo
Create your project directory and cd into it: mkdir /home/userxxx/my-jhipster-project && cd /home/userxxx/my-jhipster-project
Generate your project using jhipster: yo jhipster

Related

Not able to start react application - ENOENT: no such file or directory, but its NOT package.json file(The file is present)

I am new to react and I was following the official documentation in order to create my first react app - https://reactjs.org/docs/create-a-new-react-app.html
The commands are simple, I have read many post in many forums but I didn't see someone having this problem.
So I installed node.js with version 14.18.0 LTS which is OK as per the documentation in react (Node >= 14.0.0 and npm >= 5.6). Then I ran the 3 commands again from the documentation:
npx create-react-app my-app
cd my-app
npm start
First two commands are executed successfully, but when I run npm start it fails with the following error:
$ npm start
> my-app#0.1.0 start F:\Programming\my_location\my-app
> react-scripts start
internal/fs/utils.js:259
throw err;
^
Error: ENOENT: no such file or directory, lstat 'C:\Users\streetzaki96\AppData\Local\Temp;F:'
at Object.realpathSync (fs.js:1646:7)
at Object.<anonymous> (F:\Programming\my_location\my-app\node_modules\temp-dir\index.js:9:13)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14)
at Module.require (internal/modules/cjs/loader.js:1074:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (F:\Programming\my_location\my-app\node_modules\tempy\index.js:5:17)
at Module._compile (internal/modules/cjs/loader.js:1185:30) {
errno: -4058,
syscall: 'lstat',
code: 'ENOENT',
path: 'C:\\Users\\streetzaki96\\AppData\\Local\\Temp;F:'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#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! C:\Users\streetzaki96\AppData\Roaming\npm-cache\_logs\2021-10-05T21_31_51_222Z-debug.log
The machine which I am trying to run the code is with Windows 8.1 Pro. I also tried running the same commands on another machine which is with Windows 10 and I don't get any error there.
I tried running npm with verbose npm start --verbose to see if I can see something in the log file, but it is the same error message just with more lines of code.

npm start at reboot doesn't handle destructuring operator (Beaglebone on Debian)

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

Deploying a meteor 1.2 app to Ubuntu 16.04

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.

Google Firebase functions ImageMagick thumbnail creation failing

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

Error trying to create a project using React Native

I have been trying to use react native and create a project but have not been able to do so.
I am using the instructions from https://facebook.github.io/react-native/docs/getting-started.html
Node and watchman are already installed and then when I enter:
npm install -g react-native-cli
I get this:
/usr/local/bin/react-native -> /usr/local/lib/node_modules/react-native-cli/index.js
react-native-cli#1.0.0 /usr/local/lib/node_modules/react-native-cli
├── semver#5.3.0
├── minimist#1.2.0
├── chalk#1.1.3 (ansi-styles#2.2.1, escape-string-regexp#1.0.5, supports-color#2.0.0, has-ansi#2.0.0, strip-ansi#3.0.1)
└── prompt#0.2.14 (revalidator#0.1.8, pkginfo#0.4.0, read#1.0.7, winston#0.8.3, utile#0.2.1)
When I try to do:
react-native init AwesomeProject
I get:
This will walk you through creating a new React Native project in /Users/jaimito/AwesomeProject
Installing react-native package from npm...
npm WARN peerDependencies The peer dependency react#~15.2.1 included from react-native will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.4.0/bin/node" "/usr/local/bin/npm" "install" "--save" "--save-exact" "react-native"
npm ERR! node v6.4.0
npm ERR! npm v2.15.9
npm ERR! path /Users/jaimito/.npm/optimist/0.6.1
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/Users/jaimito/.npm/optimist/0.6.1'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, mkdir '/Users/jaimito/.npm/optimist/0.6.1'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/Users/jaimito/.npm/optimist/0.6.1',
npm ERR! parent: 'react-native' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/jaimito/AwesomeProject/npm-debug.log
`npm install --save --save-exact react-native` failed
How do I prevent the errors?
I am working on a Mac.
I used sudo at the beginning of the command. But when I did:
cd AwesomeProject
react-native run-ios
I got:
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/Users/jaimito/.babel.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at save (/Users/jaimito/AwesomeProject/node_modules/react-native/node_modules/babel-register/lib/cache.js:53:16)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:592:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
I tried using sudo at the beginning and I got this:
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/Users/jaimito/.babel.json'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at save (/Users/jaimito/AwesomeProject/node_modules/react-native/node_modules/babel-register/lib/cache.js:53:16)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:592:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
~
Process terminated. Press <enter> to close the window
Try starting the command with sudo, it'll give your command the permission to create directories in the necessary places.
If you're on windows, try open the command line with admin permissions.
If you're on mac or linux, type sudo at the begining of the command.
Either way. Make sure your target directory doesn't already exist.
For me the marked directory inside the .npm directory belonged to root:wheel. Try to get it back ;) (or the 0.3.* directory inside marked)
chown -R `whoami` ~/.npm/marked
Or if necessary
sudo chown -R `whoami` ~/.npm/marked

Resources