I'm using WebStorm.
via Terminal I tried to create new component
Typed:
sudo ng g c componentname
New component has been created,
but I'm not able to edit elements, e.g. to add new sub directory, etc,
because I'm getting error that component is read-only
I'm not sure how I can remove that status, or how can I avoid this to happen again?
To create a component, you don't need sudo. Simply type ng g c componentname.
Related
While Generating New component in angular 13 through cmd
ng g c comp1
Showing "Nothing to be done"
Any suggestion....
Make sure you are in a project directory or not.
see what I did.
I am brand new to node.js and I am trying to build my app so that I can deploy it.
Right after I do npm start I cannot do anything. Sorry if the question is too obvious, but I have never used node.js before.
Cmd says that I can build my app which is what I want but I cannot type anything.
I have tried doing npm run build before doing npm start but I get an empty index.html.
These are my package.json's scripts:
After running npm start your app is running continuously. So if you want to type a new command, you would have to stop it or open a new terminal window/tab and run that command there. Just make sure you are in the same path you want to be.
In order to stop a running process (e.g. npm start) simply press ctrl + c (that is, ctrl first, keep it pressed and then press c) no matter if you are using mac or windows
Here i added some screenshots of problem , what i get after ng command.Image appears is after ng command
and when i select any of them then it displays ng file.Image for after clicking one option from list
1I am getting 'type is not defined' error while trying to create an angular component
commands tried :
ng g c componentname
ng generate component componentname
Whenever I type node . in terminal, (I'm using Visual Studio, idk if that matters) it gives me this error:
throw err;
^
Error: Cannot find module './config'
For issues related to the terminal, try to install npm locally, it might solve the problem.
(or)
You can make the directory root of your project, as explained in this link
For issues related to compilation, you need a proper way to reference files relative to application root in Node.JS
Example: config = require('../config/config');
The folder named .. is the parent folder helps in making the path to the file, which means we can go up for two levels with this ../
When you compare (.) and (..) , (.) means current location where as .. means two levels up above the current one.
also,
Try checking ./Config with Caps instead of ./config