The project is an E-commerce site that just displays the product name. It uses mongodb app services to allow users asynchronously sign in anonymously. Below is the is a screenshot of the program.
I ran all the commands in no particular order to setup this project
npm install -g ts-node
npm install realm-web
npm install -g typescript
npx create-next-app -e with-tailwindcss
*export PATH=/usr/local/git/bin:/usr/local/bin:$PATH*
npm fund
npm install -g npx
sudo npm install npm --global
Related
I want to install create-react-app. I'm using the command: npx create-react-app my-app. I can see the following information in the console:
Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template ... added 1374 packages in 4m 163 packages are looking for funding run npm fund for details
and nothing is happening.
node and npm are the newest
In the folder I just created, I can only see node-modules, package, package-lock. I don't have a file src. How to solve this problem?
Try with these steps :
npm rm -g create-react-app
npm install -g create-react-app
npx create-react-app my-app
Update
install yarn (https://yarnpkg.com/getting-started/install)
install CRA with yarn!
yarn create react-app my-app
I have tried to run
nexe --help
or
nexe index.js
but it has returned this error:
Command 'nexe' not found, did you mean:
command 'rexe' from snap rexe (0.7)
command 'next' from deb mailutils-mh (1:3.7-2.1)
command 'next' from deb mmh (0.4-2)
command 'next' from deb nmh (1.7.1-6)
command 'nex' from deb nvi (1.81.6-15build1)
See 'snap info <snapname>' for additional versions.
I am using an Ubuntu system. How do I solve it?
Solution
First, uninstall the nexe module installed on the system locally and remove it from package.json using:
npm uninstall nexe -S
or if it is a dev dependency, use:
npm uninstall nexe -D -S
If you installed it globally, use:
npm uninstall nexe -g
Now install the package using the sudo command as a global package:
sudo npm i nexe -g
Run the command again once fully installed:
nexe --help
If it gives out the help console output, run now:
nexe index.js
I'd like to know if Javascript's npm installs dependencies OS-wide like Python's pip (if pip is not using a virtualenv), or if npm installs dependencies more like Java's mvn which stores the things in a local pom.xml file (to me mvn feels more like if it was always in a virtualenv if compared to pip).
So I mainly want to know if it's OS-wide installs or local installs that are performed with npm.
Both!!
npm install -g PACKAGE_NAME will install the package globally.
npm install PACKAGE_NAME will install the package locally in the current folder, under node_modules/.
npm install --save PACKAGE_NAME will install the package locally and save it as a dependency in your package.json.
Checkout https://www.sitepoint.com/beginners-guide-node-package-manager/
if you execute just npm install <dependency name> you are telling node to install package only on your current directory this will also create node_modules in current directory you are installing.
and if you execute the npm install -g <dependency name> with the -g you are saying that you want the node to install the dependency globally and the package will be save on the global node_modules. and most of the global dependencies can be access using CLI
example.
$ npm install mocha
you can execute the command in the current directory execute the npm install or where the node_module is
$ $PWD/node_modules/.bin/mocha -v
if you
$ npm install -g mocha
you can execute the command anywhere in your directory on the terminal
$ mocha -v
my github repository application how to Create mypkgname CLI package manager application
I have registered this package in npm, so I can install it globally:
npm install -g mypkgname-cli
mypkgname init myApp
cd myApp
npm install
npm start
just examples
npm install -g mern-cli
npm install -g #angular/cli
You may want to use some cli arg pareser like commander
or yargs
There are many other command line argument parsers.
This tutorial here explains the usage well https://developer.atlassian.com/blog/2015/11/scripting-with-node/
Important parts include
adding #!/usr/bin/env node on top of your entry point script.
in package.json, something like
"bin": {
"mycliapp": "index.js"
}
then running npm link or npm install -g on your app.
In my project directory, I installed Grunt by using the following command:
npm install grunt
...after that I did Grunt server in my project directory but it gives me command not found error.
Raj$ grunt server
-bash: grunt: command not found
And:
npm install grunt
npm WARN package.json BID-2.0#0.0.0 No description
npm WARN package.json BID-2.0#0.0.0 No repository field.
npm WARN package.json BID-2.0#0.0.0 No README data
How can I fix it?
You need to install Grunt's command line interface (CLI) globally as well.
From their site:
npm install -g grunt-cli
You may need to use sudo command (for OSX, *nix, BSD etc) or run your command shell as Administrator (for Windows) to do this.
This will put the grunt command in your system path, allowing it to be run from any directory.
You will have to install grunt after installing node / npm with: npm install -g grunt. Then it will be available at the cmd.