Install SpiderMonkey 45 failed in Ubuntu 16.04 - javascript

I tried to install SpiderMonkey 45 in Ubuntu 16.04, but I failed. I refered to SpiderMonkey Build Documentation and finished the make process.
cd js/src
autoconf-2.13
mkdir build_DBG.OBJ
cd build_DBG.OBJ
../configure --enable-debug --disable-optimize
make
After the installation, when I change the directory to ../build_DEBUG.OPT/js/src/shell and type js, the terminal gave me an error:
The program 'js' can be found in the following packages:
* nodejs
* rhino
Try: sudo apt install <selected package>
How to solve the problem? Thank you very much.

Calling js directly looks in your PATH environment variable for an executable called js. Since the directory that you built Spidermonkey in isn't in your path, the executable isn't found, causing an error.
./js expands to <your current directory>/js, which is specific enough for your terminal to find the executable and run it.
See this question for a more general explanation as to why ./executable works but executable doesn't.

Related

JavaScript Program Path Not Specified Error

I've been creating a JavaScript game for a project recently and have done it completely on the CodePen website. I now am trying to transfer it to WebStorm to turn it into a basic website. However when I try to run my code I get the following error:
I don't know how to fix it, I've looked everywhere and haven't been able to get some help. Any information would be appreciated.
Simple one, basically the error says, I don't know how to interpret this bit of code that you just gave me. You're missing local install of Node.js and NPM. Get the latest versions of these 2, and then go to File -> Settings -> Language&Frameworks -> Node.js and NPM and in the Node interpreter text box, point it to the path of where node.js was installed.
You're running this JavaScript file with Node.js that is probably not installed on your machine. It seems that you want to run and debug your app in the browser instead. For that you need to create a JavaScript run/debug configuration instead as described here: https://www.jetbrains.com/help/webstorm/debugging-javascript-in-chrome.html
On a linux machnie,
Install nodejs and npm
sudo apt-get install nodejs
sudo apt-get install npm
Get the nodejs installation folder
whereis nodejs
Should print something like:
/usr/bin/nodejs /usr/lib/nodejs /usr/include/nodejs /usr/share/nodejs /usr/share/man/man1/nodejs.1.gz
Go to:
Webstorm-> File -> Languages & Frameworks -> Node interpreter
Copy paste the installation folder to the text box.
Mac OS here. Solved the issue with:
$ brew install nodejs

building modernizr on the windows command line

So I followed the docs here:
https://github.com/modernizr/modernizr
1) cloned the repo using npm.
2) ran npm install inside modernizr to install its dependencies.
3) tried to run ./bin/modernizr -c lib/config-all.json
I am getting an error:
'.' is not recognized as an internal or external command
I am assuming that this has to do with the windows command line not understanding that I am trying to execute the file at that location. How can I do step 3 on cmd?
Thanks in advance.
Here we go. You need to run the modernizr bin from within node.
node .\bin\modernizr -c .\lib\config-all.json
Run the instructions in PowerShell. It does a better job of support *nix-style syntax and commands than the Command Prompt.
Use Git Bash (part of Git for Windows) or (iof you feel like going in the front door) Minimalist GNU For Windows (http://www.mingw.org/) It works fine.

Karma-Runner on Ubuntu: 'usr/bin/env: node: No such file or directory' error

I am trying to set up the JavaScript code tester Karma, but when I run the command to initialise karma I get the error 'usr/bin/env: node: No such file or directory'. How can I fix it?
As per #digitalmediums
I've found this is often a misnaming error, if you install from a package manager you bin may be called nodejs so you just need to symlink it like so "sudo ln -s /usr/bin/nodejs /usr/bin/node"
sudo ln -s /usr/bin/nodejs /usr/bin/node
this worked for me.
node is a reserved term in ubuntu thus node.js is actually nodejs.
I found a similar question with same issue here
Usually the non packaged node version (not nodejs) that the user installs can be run from /usr/local/bin/node
as
#!/usr/local/bin/node

beefy command not found

I am new to node.js and trying to follow this tutorial. I am getting an error on the last command beefy game.js:bundle.js --live. It says sh.exe": beefy: command not found
The beefy package version I am using is 2.1.1
Tried to Google this problem but couldn't find a solution.
I have not followed the tutorial in detail, but the response form the console means that the the console command or program called beefy is not installed. The first word of your input into the console will be interpreted to be a command (a little program) that will run.
For instance cd is a program to change directory and the next thing you enter will specify a directory to which to change.
beefy is not a command/console program that is in your system. (It is not a standard command.) Probably somewhere else in the tutorial you were instructed to install it in one of your various bin/ directories (where shell program commands are stored.)
EDIT:
TL;DR
The fix: install beefy globally (on your machine not for directory only) using npm:
npm install beefy --global

node js npm package OSX fails

After reading many ( if not all :-| ) posts having similar problems, I still don't have a working local (or a "global") install of node.js's Mac OSX system tools. Showing global attempt here...
Their doc implies either an npm install or a build from source - but not npm THEN source. However, a test run seems to be requiring compiled file(s) that don't exist after the attempted install.
Details:
It's my understanding that npm should be sufficient, but when I do the recommended
sudo npm install -g osx
npm creates /usr/local/lib/node_modules and populates with
README.md osx.cc osx.js package.json wscript
Running (from anywhere) node theirSample.js, containing:
Var osx = require('osx');
// also tried full path as recommended in other answers
var osx = require('/usr/local/lib/node_modules/osx');
The error is the commonly seen "cannot find module". However, the specific error is:
Cannot find module './build/Release/osx'
Which stems from the above osx.js created in /usr/local/lib/node_modules
That file has the errant line:
var osx = require('./build/Release/osx');
That implies that I need the ./build/Release/osx dir, but npm did not create this under the modules dir. So does that mean I need to compile the source? If so, any pointers on set up please.
First of all, you don't need to install it globally, and second, this module is already 2 years old, and it was tested on Darwin 11.2.
It does not work with OS X "Mavericks" - just tested on my machine.
As a replacement, I would recommend to take a look at os build-in module, which provides basic operating-system related utility functions, and is OS-agnostic

Categories