Issue with node module timestampnotes "command not found" - javascript

I am attempting to use an npm module named timestamp notes.
I have run the following
$npm install timestampnotes
$timestamp
and I get
timestamp:126: command not found: slk
i then tried opening a node repl
$node
>var timestamp = require('timestampnotes');
>timestamp()
and I get basically the same thing, any ideas?

I came across a similar problem. If you are running with zsh on your terminal as opposed to bash, you need to set your 'Shells open with:' option in the Preferences>General to Command (complete path) and set the path to /bin/zsh terminal Command
The same needs to be done if you are running iTerm in place of your default Terminal. You can find this also in your Preferences>Profiles>General and again set Command to /bin/zsh iTerm Command

Related

"'bun' not found" error in Windows with WSL

First, I run this command on my windows machine
$curl https://bun.sh/install | bash
Output of the above first command
Second, I run this command to set this path in the file
$nano ~/.bashrc
Output of the above second command
After setting these variables into the ~/.bashrc file.
I am trying to check the version of Bun which is just installed, with this command :
$bun --version
After running the above command I got this output :
Command 'bun' not found, did you mean:
command 'ben' from deb ben (0.9.0ubuntu2)
command 'bus' from deb atm-tools (1:2.5.1-4)
command 'zun' from deb python3-zunclient (4.0.0-0ubuntu1)
Try: apt install <deb name>
Can anyone please help me to activate Bun smoothly on my windows machine?
I can tell you that I have successfully installed Bun in Ubuntu 20.04 on WSL2. However, note that it will not currently run in WSL1 (from the Unix & Linux Stack). That's not the error you are seeing here, however.
Apologies in advance if this is not the case, but given that you are new here, I'm going to make an assumption that it might be something very basic that is causing the error you are seeing. The output of the first command indicates that Bun was installed properly, so if it's not found, it seems most likely that you missed one crucial step. You also didn't state that you did it, so ...
~/.bashrc is a file that is typically only read when you start Bash. After adding the variables to your ~/.bashrc, to have it actually set the variables in a shell session, you need to either:
source ~/.bashrc`
Or simply start a new shell (exit WSL and restart, or just run another bash inside bash, etc.
Of course, after doing this, you'll still need to be running WSL2, or you'll run into the other error.
Note that, beyond simply creating a project, I have not tested Bun extensively in WSL2. The Fireship-guy on YouTube did mention that he had some challenges in getting it to run under WSL, but I'm not sure what those were.
I've present the same problem.
Context sotware=> I use win 11 and I've download ubuntu
microsoft store
For this, I enable in feactures
windows turn on and off feactures
and clink here these options
For download bun 0.1.8
I've execute this command
curl -fsSL https://bun.sh/install | bash
late, at the console say that i have to put 2 line of code in a file in my case are :
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
When, I tried execute bun --version the console showed that did't find bun.
I restart the windows and it seems to have worked
I found answers in the post https://stackoverflow.com/a/73097326/5072481 add username path to $HOME/ is the point

How to run node in VSCode properly?

$ node test.js
internal/modules/cjs/loader.js:883
throw err;
^
I tried all the ways (adding/checking PATH route for node js, restarting, using another files etc) and couldn't find why my node doesn't run properly. When I'm typing node -v it returns me version, so it is installed, I go to VSCode and open my any folder. Then in JS file when I'm typing for instance node app.js it throws me error that I wrote above.
Any idea what should I try else?
Seems like node modules are not properly installed.
Try these steps and let me know:
delete node_modules
delete package-lock.json file
npm install
npm start
should be good to go.

bin is not recognized as an internal or external command. npm script

I'm new to node/npm and having an issue trying to start an npm script.
When I try to run a basic script like the one belown, it gives me the error "bin is not recognized as an internal or external command". I think i have had already run succesfully some previous script I made so I don't know if wether my npm is broken or if I did something wrong.
#! node
const app = require('../lib/app')
const config = {
port: 8080
}
app.listen(config.port, () => {
console.log(`Chat is waiting for you at http://localhost:${config.port}`)
})
Screenshot bin error
I have already tried uninstal - reinstall it.
I also checked this post: npm bin command - not recognized as an internal or external command and tried to run npm install -g unsucessfully.
I'm on Windows.
Nevermind.
I just understand what happend. The code was inspired from a Linux user which had the "! env node" on the first line.
I'm on Windows so I removed it but as a result, the script was just trying to run "bin/start" instead of "node bin/start".
Ridiculous error but well, at least i've learned something

Jenkins-Protractor Integration-Centos7

I am facing problem while integrating Jenkins with protractor script.
Steps:-
1. Created Freestyle project and i selected 'Execute Shell' build option and put protractor --version command.
When i build this simple job it says:- + protractor --version
/tmp/jenkins5545881549145932714.sh: line 2: protractor: command not found
Same applies to npm --version, when i run this command got error :- npm: command not found.
But node --version works fine.
I am using centos7, and when i ran these commands on server command line, it works like charm.
Please Help!!
When I had similar problem, devops fixed it by adding a statement to the command so in the result I had
export PATH=/home/ubuntu/bin:/home/ubuntu/.local/bin:/home/ubuntu/.nvm/versions/node/v10.15.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; cd ui-automation; protractor conf.js
still not completely understand what that does...
If that doesn't help, make sure your protractor and everything else are globally installed
You can get the global package install path via npm config get prefix
NPM_PREFIX=`npm config get prefix`
export PATH=$NPM_PREFIX/bin:$PATH
protractor --version

Trying to create a global npm module. When executing my command I get "The system cannot find the path specified"

I'm trying to convert a npm module I created to be used globally. https://github.com/toymachiner62/node-mongo-seeds/tree/global
When I run $ seed, it gives the error The system cannot find the path specified so it knows that it's a global command.
I'm not sure where to start debugging this. I have console.logs in all my scripts and none of them are firing so the problem lies elsewhere, but i'm not sure what to try next.
Advice?
edit
I'm now on my mac and I changed the shebang path to node in seed to #!/usr/local/bin node.
I still get these errors when trying to use my module:
$ seed
-bash: /usr/local/bin/seed: /usr/local/bin: bad interpreter: Permission denied
$ sudo seed
sudo: unable to execute /usr/local/bin/seed: Permission denied
edit
It seems this is only an issue on one of my macs. The other one works just fine..
You should name the script bin/seed.js and call it like that. Also, the path to node seems incorrect at the top of bin/seed.

Categories

Resources