Don't use asdf if there is no .tool-versions file? - asdf

I installed node.js:
brew install node
I also installed asdf with node.js plugin. Is there any way to use node.js installed via Homebrew globally if there is no .tool-versions file?
Right now I am getting an error if this file does not exist:
No version is set for command node
Consider adding one of the following versions in your config file at
nodejs 19.0.0
nodejs 19.0.1
nodejs 19.1.0
nodejs 19.2.0
I don't want to use asdf globally. Just for few projects.

Related

How do I resolve the error that occurred when migrating a windows local reactjs application to Linux?

I'm trying to migrate on linux centos8 an application in reactjs that runs well locally in w10 with localhost:3000 for react and localhost:3001 for nodejs.
I created in /home a folder for node in which I copied everything in the local node folder, except node_modules, I ran there npm install, I launched nodejs with the command node index.js, I tested some endpoints from postman, everything it's ok on the node side.
I created in /home a folder for the reactjs application, I copied everything in the local react folder except node_modules, I gave npm install, node_modules was created.
Then I give the command: npm start and get the error:
Failed to compile.
./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
Error: No valid exports main found for '/home/parcare-react-test/node_modules/colorette'
and the reacjs does not start.
What can I do?
Thanks,
Does /home/paracre-react-test/node_modules/colorette exist?
My hunch is that it's installed globally (outside the project) on the original machine.
Run npm ls -g colorette to see if that package is installed globally, and npm ls colorette from the app directory to see if it's installed locally.
If it's global on the original machine, you can install it on the destination machine with npm i -g colorette (or whatever the parent package name is if it's a dependency of something else.)
If that's the issue and you don't want to install it globally on the destination machine, just install it into the app dir with npm i -D colorette. (I'm assuming it's a devDependency. If I'm wrong about that omit the -D.)

How do I fix my "No valid exports main found" compile error?

I tried to compile the files using
npm start
but it doesn't works.
In my chrome and terminal, it says like this way.
Failed to compile
./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
Error: No valid exports main found for 'C:\Users\Jiwoo\Desktop\movie_app_2020\node_modules\colorette'
I tried to delete folder [node_modules] and typing "npm i" but it doesn't works too.
How can I fix my error?
upgrade node.js and also remove create-react-app globally by using below command
npm uninstall -g create-react-app
and using:
npx create-react-app myapp
I am using Windows 7 and the latest working Node version is 13.6. Therefore to make it run the only option is to downgrade autoprefixer: npm i autoprefixer#9.8.0
Downgrading colorette module to 1.2.0 didn't help.
The ultimate solution is to upgrade Node, however, it's not possible on Windows 7. Alternatively, one can try to compile it on a VM or with a docker image that supports Node 14+.
For windowss 7 user who are using any of the 12+ version just download the last 13 version which is v13.14.0. Before installing this version make sure to uninstall the previous version installed.
Here's the download link
Download the .msi file instead of exe file
Hope it will work
Thanks

Error while using 'new' command while creating a project in gatsby

is the error I get while I'm trying to get a new starter project in gatsby.
node version: v14.4.0
npm version: 6.14.5
gatsby version: 2.4.17
Also, the error is the same while working with recent gatsby version.
Please help or suggest something.
git is not recognized as an internal or external command
You need to install git.
it seems you are using windows so install git on windows
You may need to close the cmd and open it again in order to use git.
Since windows may not automatically add git to your PATH environment variables:
Open Git Bash which should have been installed along with Git if you downloaded the correct installer.
Type the command you want to run, it should start with git.
Press enter.

No `package.json` file found. Make sure you are running the command in a Node.js project

I am building a AngularJS file with typescript and installed tsd for typedefinitions globally. When I try to run the following command on the root of my project folder I am getting an error
I am new Angular JS using version 1.7. I am not sure if Package.json is needed for AngularJS project
Command
tsd install angular --resolve --save
Error
No package.json file found. Make sure you are running the command in a Node.js project.
package.json is required for node projects to specify metadata about project and include some important commands that may be required for the project build. First you have to install node from official website. You can google for the step by step installation. Once installed, goto your project directory and run this command. Make sure to perform "npm init" before you run the desired angular command.
Note: Ensure, node is accessible through cli
tsd is deprecated use #types node modules
npm i #types/angular --save

How to setup a MEAN in Windows 7

I have done a node.js server install and checked the node --version in the command prompt
I have done this much but I couldn't stat the npm.
It seems you have installed nodeJs already on your computer. But I will explain step by step how to setup a project with MongoDb + express + Angular + NodeJs
Install MongoDB, Configure and Run - Download MongiDb installer and install MongoDB on your computer. Follow the screen instructions. Read installation guide for windows here
Install NodeJs - Download and install NodeJs. Open command prompt and type "node -v", if this command runs without an issue, that mean you have installed NodeJs on your computer
Setup a project - Create a empty folder. Open command prompt and go inside the folder. Now type npm init. Provide answers for questions prompt in command prompt. Once you complete that you can see package.json file is created in your folder.
Install express - To install express type npm install express --save
Install bower package manager - Run npm install -g bower if you don't installed bower before on your computer. (Bower is a package manager for font end websites.)
Install AngularJs - Run bower install angular --save command to install angular
Create a NodeJs Server - Create a file index.js. This will be an entry point of your nodeJs app
const express = require('express')
const app = express()
app.get('/', function (req, res) {
res.send('Hello World!')
})
app.listen(3000, function () {
console.log('Example app listening on port 3000!')
})
Run node index.js. Your website is now running on http://localhost:3000.
Please read some tutorial here to get more information
If you have every thing installed (Mongo,Node) then you can try yeoman application generator.It will create a sample application for you with all the required folders and you just need node modules and bower components to install.
Please read this here:-
http://yeoman.io/
You don't need to bother any thing for any of your folders

Resources