I'm trying to use the NPM javascript build tool Jake. I cannot run it from the command line - jake

I installed Jake this way:
npm install -g jake
But now what? All the examples of people using Jake execute it from the command line like so:
jake
but when I do that I see this:
'jake' is not recognized as an internal or external command,
operable program or batch file.
Yes, I rebooted.
Yes, npm itself works.
If there's anything to put in the Path system environment variable, I don't know what it is.
I tried adding C:\Users[me]\AppData\Roaming\npm\node_modules to the Path system environment variable and that didn't work.
I Googled this problem without success and was hoping maybe there is some secret that someone knows that I do not.

Related

'astro' is not recognized as an internal or external command, operable program or batch file

I was able to run my website before but now it won't let me. I tried to download old code from my branch history and it's not still working. Not sure what I did. I tried looking up ways to resolve but couldn't find anything. Does anyone have any ideas?
I ran npm install again and it solved the problem.

The system cannot find the path specified. Install for [ 'create-react-app#latest' ] failed with code 1 [duplicate]

So I've been trying to install gulp and I keep getting:
module.js:471^throw err : cannot find module 'C:\c\Users\Joe's Steezy
Laptop\AppData\Roaming\npm\node_modules\gulp-cli\bin\gulp.js'
As you can see my username has spaces in it and I read that npm cant read paths that have spaces. my question is how do i fix this? I know theres the option to do symbolic links, and there is an option to make a whole new user and make sure the username folder doesn't have any spaces in it this time.
Is there another way I can do this? I don't trust myself enough to do a symbolic link because i read that it can really mess up your system if you mess it up. I also don't really want to make a whole new user on my laptop because then i have to install all my programs all over again which kind of sucks. Please if anyone can help, it would be much appreciated!
This works for windows. You can use the short path name in the environment variable, e.g. use "C:\PROGRA~1\nodejs" instead of "C:\Progam Files\nodejs".
You can find out the correct short name of your folder by executing dir /x in the parent folder.
This is for those who all are facing the issue and didn't get any workaround. What you can do is change the cache path using below command:
npm config set cache "C:\Users\FirstName~1\AppData\Roaming\npm-cache" --global
Here FirstName is path name which includes spaces between them.

npm package.json: How to wrap long single function scripts?

I have created an npm package script for npx depcheck and one of its parameters, --ignore, its value is getting very long and I expect will get longer.
"audit:depcheck": "npx depcheck --specials=bin --ignore-dirs=dist,node_modules --ignores=tslint,gts,ts-node,ts-node-dev,typescript,mocha,winston,passport-springcm,passport-box,passport-dropbox-oauth2,passport-google-oauth20,passport-microsoft,mocha,nyc",
Tried: I have tried just simply breaking the very long script into new lines but this approach is not JSON compliant.
Goal: Do the same thing, but readable within 110 character width editor.
You can write a shell script, like (do not copy-paste it exactly, just to get the idea):
#!/usr/bin/env bash
npx depcheck --specials=bin --ignore-dirs=dist,node_modules --ignores=tslint,gts,ts-node,ts-node-dev,typescript,mocha,winston,passport-springcm,passport-box,passport-dropbox-oauth2,passport-google-oauth20,passport-microsoft,mocha,nyc
Name it something descriptive, for example npx_depcheck.sh or something else you want. Then call the shell script from package.json:
"audit:depcheck": "./npx_depcheck.sh",
Note: make sure your script can run: chmod u+x ./npx_depcheck.sh
Edit: as #RobC wrote, this solution expects that the system has a shell. The point is, you can attach any kind of scripts, just keep in mind that different environments have different runtimes and tools (a Node.js script makes sense, since the environment where you want to run your application most likely has Node.JS installed).

Pathing commands on Windows 10

This is one of the problems where I don't even know how to properly frame the question.
I'm trying to follow a React course on Lynda.com
The instructor says to type into my command window the following:
node_modules/.bin/webpack-dev-server
But when I enter it I get
'node_modules' is not recognized as an internal or external command,
operable program or batch file
The autocomplete will fill in "node_modules" but not ".bin". I've checked that webpack-dev-server.cmd is inside the .bin folder, and that npm is in my proper path. (yarn and npm both work as commands in this folder.)
I've tried several different command shells including ConEmu, but all throw the same error.
I'm really at a loss for how to proceed from here. Is the problem that the instructor is using a different operating system and I'm just missing a subtle difference in the way that I have to enter the command?

NPM on LEMP cannot find module, wrong path

Total Linux noob here. I am trying to configure a Pleroma development environment on DO droplet. Installed LEMP, installed SSL, installed PostgreSQL, installed Pleroma, so far so good.
Then I installed Node, NPM, cloned Pleroma-FE (apparently it installs in /user/pleroma-fe folder). I am following the very brief build instructions here:
https://git.pleroma.social/pleroma/pleroma-fe
When I get to the command in those build instructions: npm run build
I am getting error: Error: Cannot find module '/user/build/build.js'
It's because actual path to the build file is /user/pleroma-fe/build/build.js
Apologies if this is a duplicate. I see other questions about this.
Fixing npm path in Windows 8 and 10
and the reply seems to set the PATH. This answer might apply to my situation. But my question is: it is clearly already looking in a well defined path (which is different from all the other questions, which don't seem to have well defined path in the error message). But it is the wrong path. How do I make it look in the correct path?
I tried the npm command and specified the complete path, and every variation. and none worked. So it seems fixing the path won't fix this problem.
Sorry I do not currently know enough Linux to be able to fix this. I tried to tag this with Pleroma but I don't have enough reputation to create a new tag. Any help is much appreciated. Thanks in advance.
I continued to work on this with some help of a Linux admin on Fiverr and the Pleroma developers chat with success, thanks to all.
The solution did not involve changing the path. There were several different things going on. First, I needed to change directory into the development project source folder:
cd pleroma-fe
Once I did that, npm found the build module. Next issue was Node was very old and I needed to get the latest version. I used the instruction here for NodeJS (10):
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
Next issue was npm was missing some modules. This was fixed with:
npm install
After that the build completed with no errors.
npm run build
After a successful build, you will see a list of files that have changed as a result of the build.
Next issue is that simple changes in HTML text were not live, ie. not reflected in the refreshed web page. This is fixed by copying all the resulting build files to the production folder using rsync. In my case the command was:
rsync -av /user/pleroma-fe/dist/ /home/pleroma/pleroma/priv/static/
Pleroma is a neat Twitter-like user interface to ActivityPub fediverse, it includes a Mastodon UI as well, and thanks to the developers for making it free and open source.