Vue CLI 3 doesn't create .vuerc file - vue.js

I'm using Vue CLI 3.5.1 on Ubuntu 16.04 to create some test projects. As per the doc, I should have a .vuerc file created in my Home directory. However, when I run:
vue create test-project
no such file is created. Projects work fine but running vue config gives the following error:
lundincast#lundincast:~/Vuejs-projects/test-app$ vue config
ERROR
Error: ENOENT: no such file or directory, open /home/lundincast/.vuerc > Error: ENOENT: no such file or directory,
open '/home/lundincast/.vuerc'
I've tried with several option (saving preset or not, etc...) to no avail. Why isn't that config file created?

.vuerc files are only created after you have asked vue cli to save a preset for you at the end of the vue create process prompts
The file is stored in your user directory and can be edited with vue config --edit

After running:
vue create hello-world
.vuerc file will be created in your user root diretory

Related

Error: ENOENT: no such file or directory, open 'C:\Users\username\Desktop\vue-tailwind-naive\tailwind.config.js'

So I have been trying to install tailwind inside a Vue Project.
I initialized the vue project using:
vue create project-name.
Then I add tailwind as a plugin using the command:
vue add tailwind and then select the minimal option. I suspect the plugin is installed correctly but still I get the below error :
In the package.json, tailwind & autoprefixer can be seen correctly installed. Also postcss.config.js & vue.config.js files have been added successfully & correctly.
But when I run to serve the page, I get this error:
I can't figure out what's going wrong here. Please help.
Try to delete the postcss.config.js then run the following command at the project root :
npx tailwindcss init -p
this command will create postcss.config.js and tailwind.config.js files.
In my case I changed the ("./tailwind.config.js") to ("./tailwind.config.cjs") in postcss.config.cjs plugins

How do I specify a valid entry point / file for Vue projects?

Came back to an old Vue project. Try to bring it up on my local machine using 'vue serve' and I got the following error.
How do I specify a valid entry point for vue projects?
Command:
vue serve
Terminal Error:
"Failed to locate entry file in /Users/$username/Desktop/my-project.
"Valid entry file should be one of: main.js, index.js, App.vue or app.vue.
vue serve src/main.js
Need to add the file to start from after the serve command
npm run serve
need to type this command .
A better way of doing this would be to specify the path to the main.js file in the package.json file as follows:
"scripts": {
"dev": "vue serve src/main.js",
"prod": "vue build src/main.js"
}
And then simply run
npm run dev
for serving the project in the development environment and
npm run prod
for creating a production build under dist folder

npm config list - multiple config

i have created a project using npm init and i created a .npmrc file with some config. when i check the npm config list i am getting project config and userconfig.
do i need to remove the userconfig , but i am not able to edit the file.
i am not understanding why we need the .npmrc file , when you hit a command npm install express , all the config is done in the npm config file ?
how to edit the .npmrc global file in ubuntu ?
do we need to remove the userconfig if we need to use project config ? or its something like which ever comes it takes that
By Searching , i found some infos
when you install npm you have a global config file, whenever you need to access the global config file you can just add -g command
example : npm config list -g
for every projects you can create a .npmrc file, in that file you can configure and you will have private kind of stuff like the packages which are hosted private
so for that you need to create a .npmrc file , if you check npm config list you will have both configs (.npmrc in project folder) and (.npmrc in global)
so its like first it will check with the config in the project folder, if there is no config for project folder it will check for the global config(userconfig)
no need to remove the global config , it will take first comes first serve so the project folder config will be taken if its there otherwise only it will check for the global config
Editing the Global config file
you can edit the global config file by going to
cd /
cd home/"username"/
vi .npmrc
change the file save it by using press esc type :x

Vue-router. Error in the browser console after using "npm update" command. Error: Module build failed: Error: ENOENT: no such file or directory

Before updating project was working.
After updating with "npm update" command, browser console shows:
Error: Module build failed: Error: ENOENT: no such file or directory,
open
'C:\xampp\htdocs\beauty\node_modules\vue-router\dist\vue-router.esm.js'
In my bootstap file I add Vue-router like thiss
import VueRouter from 'vue-router';
window.Vue.use(VueRouter);
I don't understand where is problem and what should i do?
In my case, I had to restart the dev server since I've switched to a branch that had TypeScript introduced while started dev server on another (feature branch) that added vue-router but didn't have TS. I've merged and was puzzled why I got this error until I've realised that dev server probably doesn't recognize TS at all (depending on switching main.js to .ts and back I had the same or different error).

Less file watcher in PhpStorm produces: lessc: ENOENT: no such file or directory

I am trying to set up an file watcher for .less files, but it isn't working.
I have globally installed less via npm (npm install -g less). And after this I set up the file watcher according to this documentation from JetBrains supprt. Here is a picture of the settings:
Everytime I will change my .less files, it will produce the following error:
/usr/local/lib/node_modules/less/bin/lessc --no-color styles.less
lessc: ENOENT: no such file or directory, open '/Applications/PhpStorm.app/Contents/bin/styles.less'
Process finished with exit code 1
What went wrong? Any suggestions?
Using the less compiler directly in the project folder via the command line works perfectly (e.g. $ lessc styles.less styles.css)
Using the less compiler directly in the project folder via the command -- line works perfectly (e.g. $ lessc styles.less styles.css)
Try doing the same then -- please try with $FileDir$ in the "Working Directory" field.