how to set environment variable in lumber framework? - javascript

Install Lumber
npm install -g lumber-cli -s
then,
lumber generate "adminpanel_test" --connection-url "mysql://root#localhost:3306/admin-dev" --ssl "false" --application-host "localhost" --application-port "3310"
lumber is not recognized as an internal or external command

lumber-cli is not installed properly on your shell.
If you run this you can see the reason why it is stop installing.
npm install -g lumber-cli
Sometimes it can work if you are working on local env.
sudo npm install -g lumber-cli

You can also try to install it locally:
$ npm install —save-dev lumber-cli

Related

i can't install any node packages with npm install

I try to install node packeges with nmp. When i run, it says:
up to date, audited 356 packages in 7s
found 0 vulnerabilities
I see it as a dependency in my package-json like this:
"dependencies": {
"express": "*",
"nodemon": "*"
}
but there is no node_modules was installed..
Hope someone can help.
edit: I tried the commands given in the answers but it didn't work. still same
ss from editor
These commands solve the same problem and have a look at the attached links.
https://github.com/npm/npm/issues/17282
Can't install anything using "npm install"
npm install -g npm
npm cache clean
npm update
npm install
There are a few fixes to this issue.
The first one is to install the dependencies manually, as so.
$ npm install -s express nodemon
The command should install express and nodemon at the latest versions.
The second option is to run a few commands, as so (in the order given).
$ npm install -g npm
$ npm cache clean --force
$ npm update
$ npm install
Basically, these are what the commands do (from 1-4).
This installs npm from npm (sounds weird, but there is an npm package).
This command forcefully cleans out the cache of npm.
As you can tell, npm update updates npm!
Finally, this command should be run in a directory where there is a package.json file. This installs all the dependencies listed in package.json.
Don't type out the $ in the terminal examples!

Cordova: command not found after installing globally

I try to install Cordova in macOS Mojave. I run the following command to install globally. It is installed successfully npm i -g cordova
but when I check the version using cordova --version , It gives me the error "cordova: command not found".
and also when I try to get the location using which cordova, It returns nothing.
Refer this great write up: http://blog.webbb.be/command-not-found-node-npm/
This can happen when npm is installing to a location that is not the standard and is not in your path.
To check where npm is installing, run: npm root -g
It SHOULD say /usr/local/lib/node_modules, If it doesn't then follow this:
Set it to the correct PATH:
run: npm config set prefix /usr/local
Then reinstall your npm package(s) with -g:
npm install -g cordova etc
If this doesn't work then try adding the global path of cordova(where it got installed) to your $PATH variable.

npm: not found when setting up Jenkins Server?

This is my first time setting up a jenkins server. The build is using Amazon's EC2 and Ubuntu 14.04.
I've installed node and npm via nvm.
node -v
>v0.11.14
npm -v
>2.0.0
The repo pulls down just fine into my /var/lib/jenkins/workspace/morningharwood folder.
Problem: When I add my script it breaks
Here's my build script which errors out? I have no idea what i'm doing. I copied this from a tutorial.
QUESTION: How do I properly write my script to npm install, bower install and lastly, grunt test
You could install node, npm, bower and grunt by doing following:
sudo apt-get install node
sudo npm install bower
sudo npm install grunt
To install a package from local source, use
npm install /path
Try using NodeJS plugin for Jenkins: https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin
This will solve npm command not found issue on jenkins even installed on server
sudo mkdir /usr/local/nvm
export NVM_DIR=/usr/local/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh |NVM_DIR=/usr/local/nvm bash
. /usr/local/nvm/nvm.sh
nvm install 10.15.3 -g
npm install #angular/cli -g
Include following on build execute shell command in jenkins:
export PATH="$PATH:/usr/local/nvm/versions/node/v10.15.3/bin"
npm install

npm install vs sudo npm install -g

for some packages I have to run sudo npm install -g while for others npm install will suffice.
Why and what's the difference?
For example:
npm install -g grunt-cli # doesn't work
sudo npm install -g grunt-cli # works
npm install websocket-stream # works
Is sudo necessary only with the -g flag?
npm installs packages locally, ie. in a node_modules folder inside your current folder. This allows your application to depend on specific packages versions, without having to mess up with a global list of installed packages on your system. See the first paragraph of Isaac's blog post (Handle multiple versions of the same thing at the same time), which explains well how npm avoids the dependency hell often encountered in other programming ecosystems.
On the other hand, some packages are meant to be used as command line utilities, such as grunt-cli, mocha or json. In order to use them everywhere, you need to install them globally, hence the -g parameter.
Please note that you shouldn't need sudo to install global packages, see this relevant answer for more information.
Looks like permissions issue. -g install it globally (you will need to 'root'), but its not a good idea to install that as root
In terminal run:
sudo chown -R `whoami` ~/.npm
npm install -g grunt-cli installs the package in the global mode, every user could use it.
Without -g you just install it in the current directory.
If you are not the root user, you need to use sudo for the -g.
If you use npm without -g and you have write permission to the current directory, then
sudo is not necessary. Otherwise, you still need it.
-g is global, without just installs the package locally.
You run it with sudo as it installs to folders which your default user may not have access to by default.
grunt-cli will provide an executable that will be put in your PATH, so depending on how you configured your system it will require root access.
See this post from npm creator, particularly the part about using sudo with npm.
websocket-stream is a library, your code will use it so it will be easier to perform some tasks, usually it will be installed at the root of your project, in the node_modules folder.

jscoverage does not work without -g option

npm install jscoverage -g
What does the -g option do?
If I skip the -g option, jscoverage is not recognized as a valid command.
The -g flag tells npm to install it globally to your PATH. Without that, it would just be installed locally into your project folder.

Categories