yo angular-fullstack failure installing on linux local - angularjs

Getting the error below. I tried running as sudo and as myself. Same error. This is Linux mint Rosa. The install gets through the yo questionnaire but fails on permissions what looks like it. I am new to Linux. Please help.
create bower.json
fs.js:549
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/home/mastermean/bower.json'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.writeFileSync (fs.js:1156:15)
at write (/usr/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/commit.js:14:6)
at DestroyableTransform._transform (/usr/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/commit.js:43:7)
at DestroyableTransform.Transform._read (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_transform.js:172:10)
at DestroyableTransform.Transform._write (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_transform.js:160:12)
at doWrite (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_writable.js:335:12)
at writeOrBuffer (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_writable.js:321:5)
at DestroyableTransform.Writable.write (/usr/lib/node_modules/generator-angular-fullstack/node_modules/readable-stream/lib/_stream_writable.js:248:11)
jul#jul-Inspiron-5558 /home/mastermean $

Try running this from a terminal:
cd ~
mkdir app
cd app
yo angular-fullstack
(It may be necessary to run that last command as sudo yo angular-fullstack depending on how yeoman was installed.)
It looks like the file bower.json does not have write permission. You may be able to fix the issue by fixing your existing permissions, but the above sequence should get you going without mucking about with permissions.

Related

opam init fails - unable to create temp file

I have installed opam 2.1.0 on a Linux Virtualbox VM. When I try opam init, I get the following error:
<><> Fetching repository information ><><><><><><><><><><><><><><><><><><><><><>
[ERROR] Could not update repository "default": OpamDownload.Download_fail(_, "Curl
failed: \"/snap/bin/curl --write-out %{http_code}\\\\n --retry 3
--retry-delay 2 --user-agent opam/2.1.0 -L -o
/tmp/opam-32196-d33843/index.tar.gz.part --
https://opam.ocaml.org/index.tar.gz\" exited with code 23")
[ERROR] Initial download of repository failed.
Running with --disable-sandboxing doesn't help. I know that its a problem creating/writing to /tmp/opam-... directory because if I replace that with my current directory or home directory the command by itself runs fine. It also runs fine with /tmp/opam-... if I use the --create-dirs option in curl but I don't have any way of getting opam init to use that option. Any ideas?
thanks
Update
The reason opam init failed for me was because curl was installed with snap on my system. This exactly what is going on with your VM.
Try to run opam init -verbose and that could reveal more about why you ran into an error.
In my case I needed to install other things with opam and it kept failing every time. So snap uninstall curl and then sudo apt install curl fixed things. (Was only able to figure this out with help from my professor)
Workaround
I ran into the same issue and I found a workaround on the OCaml forum: here. (Credits to UnixJunkie)
You can run:
opam init github git+https://github.com/ocaml/opam-repository.git
This should avoid the certificate issues. This worked for me.
I tried to fix the certificate issues using this answer as well. You could try doing that, but it seems complicated when the workaround is to simply point it to the github repo directly.
This question is similar to this one.

Cannot find module gulp.js

I checked-out a solution from TFS and I have this error in my console when trying to clean & build a solution - > Error: Cannot find module 'C:..\node_modules\gulp\bin\gulp.js'.
Any idea why is not found?
I tried already to reinstall npm and gulp ( also globally ).
Try this:
cd /usr/lib/node_modules/gulp/node_modules/v8flags
sudo node fetch.js
And that's it. The last instruction will create the required file.

npm start on new create-react-app build returns ELIFECYCLE error

Made a new react app using create-react-app and now getting the following error in the terminal when running npm start:
> react-scripts start
Attempting to bind to HOST environment variable: x86_64-apple-darwin13.4.0
If this was unintentional, check that you haven't mistakenly set it in your shell.
events.js:167
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND x86_64-apple-darwin13.4.0
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)
Emitted 'error' event at:
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1468:12)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aqi#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the aqi#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! /Users/chris/.npm/_logs/2018-12-24T10_07_46_970Z-debug.log
Tried removing the node-module folder and npm install.
type unset HOST in the terminal. It will solve the issue.
I struggled with this exact issue for an entire day. If you do unset HOST, it will solve it, but temporarily. The simple solution to this bug is as follows (this is for Mac, for Window the commands may differ):
Open your bash with the following command: open ~/.bash_profile
Write this down (exactly what it says) all the way down the file once the file opens: HOST="localhost"
After that, save the file and quit (Command + q)
Finally, reload the environment by typing this on the terminal:
source ~/.bash_profile
If you do all the steps correctly, this should resolve the bug.
Mostly the problem occurs when you set a specific hostname instead of regular used one localhost.
On Mac/Linux terminal run hostname, you will receive the specified hostname. If it's something different than localhost refer to your bash profile config file (ie for ZSH it's .zshrc, or for Bash it's .bashrc in your home directory); and if HOST=localhost exists in the profile comment it.
PS: do not forget to restart your terminal to make the change takes effect.
I also struggled with this. Many online solutions only solve the first part. Here I'll provide my approach to fully solve the issue and make npm start work
Understand the issue:
There are 2 parts to the problem. First, you want to set your environmental variable, HOST, to "localhost". You can do it by typing in your terminal (anywhere):
nano ~/.bash_profile
In the bash file, type HOST="localhost" in a new line and type: export HOST. This directs your program to go to this HOST by default
Save change by Ctrl + X, then press Y (Yes), then press Enter
Return to your terminal, run: source ~/.bash_profile to refresh the terminal
Now, your computer has updated its HOST variable to localhost. You can check that by typing: env | grep HOST in the terminal. Grep means to grab that variable in the variable list.
Hopefully that solves the issue fully. If you then encounter: dyld: lazy symbol binding failed.
This simply means there's something wrong with the fsevents. Why? I am not sure, but a sure fix is by deleting the node_modules/fsevent files from my search. A permanent fix is to remove the node modules and re-do the npm install. Make sure that fsevent is version 2.0+!
Hope that helps. This surely took some time to debug!
References:
dyld: lazy symbol binding failed: Symbol not found: _node_module_register
https://medium.com/#choy/fixing-create-react-app-when-npm-fails-to-start-because-your-host-environment-variable-is-being-4c8a9fa0b461
https://medium.com/#youngstone89/setting-up-environment-variables-in-mac-os-28e5941c771c
I was able to fix the similar error by running npm install create-react-app instead of npm install -g create-react-app. Hope it helps.
you should create .env files
https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-development-environment-variables-in-env
read this Environments in Create React App
https://serverless-stack.com/chapters/environments-in-create-react-app.html
unset HOST
This worked for me, if not, then run the code and give it a reboot
I ran into this issue because I usually had anaconda running as default in the terminal. So my login is not just my computer login account but appending with some string created by conda. (eg xxx#xxx)
However, in order to get the react server up and running normally you will need to have your login as your computer login id. (eg xxx#)
There are two solutions to achieve this.
to run unset HOST, it will get rid of the string at # of your terminal log in id.
to add HOST as env var to your terminal config file. For zsh user (most likely cos mac now run zsh as default in the terminal) You need to add export HOST="localhost" or export HOST="" to ~/.zshrc and run source ~/.zshrc in the terminal to refresh the new zsh config. You can do the same to bash config file by following one of the answers above.
GOOD LUCK.
Attempting to bind to HOST environment variable: x86_64-apple-darwin13.4.0
If this was unintentional, check that you haven't mistakenly set it in your shell.
This issue comes once we write npm start in terminal, to rectify the issue in your terminal before executing the command npm start write unset HOST then write the command npm start it works fine and you can check on localhost://3000

Yeoman gulp-angular give error Eacces Permission denied

When I tried to install the application using yo gulp-angular my-first-app, it gives me error
Error :
return binding.open(pathModule._makeLog(path),stringtoFlag(flags),mode);
Eacces permission denied.
The full error stack has been attached as image from terminal .
I do not think I am doing something wrong.
This problem is with the MAC OS X EL Captain. If you have not the permission to create a folder or file you need to give it explicitly.
Follow the below link for
https://support.apple.com/kb/PH22196?locale=en_US&viewlocale=en_US

Error: EPERM: operation not permitted, open "C"

I am getting following error while running a build definition.
I tried to give read/write permission by right clicking the Builds directory, but after running the build using build definition the permissions get reset.
The files get created by calling "gulp" command from a post script bat file.
How to get rid of this error?
I was wondering if it's related to the npm install issue. Please refer this npm install fails on Windows with "EPERM, operation not permitted" for more details.
Here is also a similar question Visual Studio 2015 hybrid app - getting "EPERM, operation not permitted"

Resources