smash: command not found (npm) - d3.js

I am trying to install an Elm-d3 connector I found on Github.
Elm is a functional-reactive programming language Evan Czaplicki
d3.js is the popular graphics meta-library by Michael Bostock
Elm-d3 enables you create type-safe, composable widgets using HTML, SVG, and CSS. D3 acts as a conceptual basis for the library, as well as an alternative renderer for Elm.
The first two install instructions are:
npm install smash
make
Installing smash goes smoothly (although I have to use sudo)
npm http GET https://registry.npmjs.org/smash
npm http 304 https://registry.npmjs.org/smash
npm http GET https://registry.npmjs.org/queue-async
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/queue-async
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/wordwrap
smash#0.0.12 ../../../node_modules/smash
├── queue-async#1.0.7
└── optimist#0.3.7 (wordwrap#0.0.2)
However after installing I can't seem to refer to smash, which merges Javascript files together into one.
$ smash
bash: smash: command not found
I don't think node.js is actually used anywhere, just organized by npm. Why can't I find smash after installing it?
When I try to run make I get related errors:
make: node_modules/.bin/smash: Command not found
make: Nothing to be done for `all'.

If you want to use smash (or just about any other npm program) from your bash prompt you need to install it globally by using the -g flag.
npm install -g smash

Related

Your JET project does not have oraclejet-tooling installed

I recently installed Oracle jet and I haven't made any changes to it. I created my first project today and it's showing error when I try to build it or serve it. I am trying to run it on Visual Studio (I don't this matters tho)
This is the error I am getting
PM> ojet serve ojet : [31mError: Your JET project does not have oraclejet-tooling installed.[0m
At line:1 char:
+ ojet serve
+ ~~~~~~~~~~
+ CategoryInfo : NotSpecified: ([31mError: You... installed.[0m:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
UPDATE: Apparently when I create a new template it is creating an error from there itself the app structure is generated but during invoking mom install it is unable to parse through some certain JSON
Following is the Error:
ojet create ojetnavbar --template=navbar
Processing template: navbar
Your app structure is generated. Continuing with library install.
Performing npm install may take a bit.
Invoking npm install.
npm WARN deprecated coffee-script#1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm ERR! Unexpected end of JSON input while parsing near '...oIzTWjIvO8rspcLCK+1pI'
npm ERR! A complete log of this run can be found in:
npm ERR! *location of log*
Error: (during Invoking npm install.) 1
$ npm install -g #oracle/ojet-cli
$ npm install -g #oracle/oraclejet-tooling
$ ojet restore
This will solve your problem
I have sorted out on the issue it was because the JSON npm was trying to parse were mostly cached and due to that a parsing error was occurring
I used npm-cache clean on my PC and all of it ran after that perfectly fine.
I think you need to add oraclejet tooling to your project. Try this:
cd appDir
npm install #oracle/oraclejet-tooling --save
oraclejet-tooling package has been deprecated, you have to use module contains a command-line interface for Oracle JET web and hybrid mobile application development.
See https://www.npmjs.com/package/#oracle/ojet-cli
cd oracle-jet-simple-web
npm install #oracle/ojet-cli --save
For me this helped
npm i #oracle/oraclejet-tooling
Here is the link: npmjs.com/package/#oracle/oraclejet-tooling

'npm-windows-upgrade' is not recognized as an internal or external command

I ran
$ npm install --global --production npm-windows-upgrade
and it returned this positive looking feedback
├── cli-spinner#0.2.5
├── commander#2.9.0 (graceful-readlink#1.0.1)
├── chalk#1.1.3 (ansi-styles#2.2.1, escape-string-regexp#1.0.5, supports-color#2
.0.0, strip-ansi#3.0.1, has-ansi#2.0.0)
├── promise#7.1.1 (asap#2.0.4)
├── inquirer#1.0.3 (ansi-escapes#1.4.0, mute-stream#0.0.6, through#2.3.8, cli-wi
dth#2.1.0, strip-ansi#3.0.1, figures#1.7.0, pinkie-promise#2.0.1, run-async#2.2.
0, string-width#1.0.1, cli-cursor#1.0.2, rx#4.1.0, lodash#4.14.0)
├── babel-polyfill#6.9.1 (regenerator-runtime#0.9.5, babel-runtime#6.9.2, core-j
s#2.4.1)
├── regenerator-runtime-only#0.8.38 (promise#6.1.0, es6-symbol#2.0.1)
└── prompt#1.0.0 (revalidator#0.1.8, pkginfo#0.4.0, colors#1.1.2, read#1.0.7, ut
ile#0.3.0, winston#2.1.1)
But when I run
$ npm-windows-upgrade
I get
'$ npm-windows-upgrade' is not recognized as an internal or external
command
I was following the directions here. Any idea what's going on? I've been googling it for a while and not getting much more than those basic instructions.
UPDATE
Realized the issue was with everything I was trying to install globally. I thought the other packages I was trying to run worked but they did not. For example $ webpack returns the same error after installing it gloablly.
BACKGROUND
I'm running windows and had previously installed npm. When that started giving me all sorts of bugs I upgraded to npm3. I belive it was just
$ npm install npm3 -g
and then running all my commands starting with npm3, for example
$ npm3 install webpack --save
Today the same command gave me
'npm3' is not recognized as an internal or external command
So I tried to reinstall it with regular npm which gave me "'npm' ins not recognized..."
I was able to get npm working again after following these lovely instructions, but cannot figure out how to get back to version 3.
Also $ npm -v right now is 2.15.1
To answer my own question.
The problem was my path settings. Npm itself was working, but for some reason the location where it was installing global node modules was in different directory. I saw this when I ran
$ npm install npm-windows-upgrade -g
The first few lines it prints when you install show where it is being installed.
I noticed it was being installed in
C:\Users\(my_username)\AppData\Roaming\npm\nodemodules\npm-windows-upgrade
even though I had just fixed npm by pointing it to
C:\ProgramFiles\npm
so I changed that to the npm location it was actually using to
C:\Users\(my_username)\AppData\Roaming\npm
restarted my computer and it worked.
Here again are instructions to change your path variables.

With Node 0.12.2 and npm 2.7.4 ionic installation error on windows 7

I am downloaded the node installation file "node-v0.12.2-x64.msi" for 64 bit windows 7 OS. All node and npm commands are working fine. I checked both the node and npm versions.
But when I try to install ionic by the following command:
npm install -g cordova ionic
Its gives me the following error:
npm WARN engine cordova-js#3.9.0: wanted: {"node":"~0.10.x"} (current: {"node":"
0.12.2","npm":"2.7.4"})
npm WARN engine npm#1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":
"0.12.2","npm":"2.7.4"})
npm WARN engine xmlbuilder#2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {
"node":"0.12.2","npm":"2.7.4"})
npm WARN installMany normalize-package-data was bundled with npm#1.3.4, but bund
led package wasn't found in unpacked tree
npm ERR! tar.unpack untar error C:\Users\Biswarup\AppData\Local\Temp\npm-1484-8b
f97a1e\registry.npmjs.org\request\-\request-2.9.203.tgz
npm ERR! cb() never called!
Biswarup is my username in above all cases.
I check the following links for troubleshooting, but nothing works for me.
https://github.com/npm/npm/wiki/Troubleshooting#error-enoent-stat-cusersuserappdataroamingnpm-on-windows-7
https://github.com/diegonetto/generator-ionic/issues/42
Please guide me, I am totally stuck at that point. Try to removing node js and reinstalling it many times. But nothing goes right.
First of all packages warning you, that it requires nodejs 0.10.x and may be that is a reason.
Another try you can upgrade npm and try to found new version. So here steps to do it:
npm cache clean
npm update -g npm
npm cache clean
Please download Node 0.10.38
I was too having problem with newer version of node.
I have already aswered this in detail https://stackoverflow.com/a/31124491/1276616

NPM has stopped working on Windows 7 64bit, hangs on install/update

At some point my version of NPM stopped working. It seems to have happened when I tried to update npm (from 1.4 shipping with node to a modern 2.x version) a few weeks ago and has steadily gotten worse. I had to change the Environment variable to point to my npm directory before my node directory (to pick up the new version of npm), at that point everything just stopped working. I switched the environment variable back, and then updates would just hang. But strangely when I tried to debug it and add a --verbose to the command the update would work most of the time. Sometimes they hung on the
npm http GET https://registry.npmjs.org/PACKAGE_NAME
but most of the time they worked. This now happens with the old version of NPM (1.4.1) and the new version that I installed (2.1.17), everything always fails on a GET command (usually but not always the first one). I have hit cache-clear, I have wiped out the temp directory, I have tried wiping out %APPDATA/roaming/npm/, and reinstalling everything. I have no proxy in place, but I have run:
npm config set proxy
to set the proxy to blank. I have set the registry to http (rather than https) and set strict-ssl to false. I have uninstalled and reinstalled nodejs, to no luck. I have tried running the commands from an admin cmd prompt rather than a normal command prompt all to no avail. I've run out of ideas, and really need NPM to work...
Below is the output of trying to install grunt-cli after clearing out the %APPDATA/roaming/npm directory:
C:\Users\Kris Erickson>npm install -g grunt-cli --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '-g',
npm verb cli 'grunt-cli',
npm verb cli '--verbose' ]
npm info using npm#1.4.28
npm info using node#v0.10.35
npm verb node symlink C:\Program Files\nodejs\\node.exe
npm verb cache add [ 'grunt-cli', null ]
npm verb cache add name=undefined spec="grunt-cli" args=["grunt-cli",null]
npm verb parsed url { protocol: null,
npm verb parsed url slashes: null,
npm verb parsed url auth: null,
npm verb parsed url host: null,
npm verb parsed url port: null,
npm verb parsed url hostname: null,
npm verb parsed url hash: null,
npm verb parsed url search: null,
npm verb parsed url query: null,
npm verb parsed url pathname: 'grunt-cli',
npm verb parsed url path: 'grunt-cli',
npm verb parsed url href: 'grunt-cli' }
npm verb lock grunt-cli C:\Users\Kris Erickson\AppData\Roaming\npm-cache\671ef8ac-grunt-cli.lock
npm verb addNamed [ 'grunt-cli', '' ]
npm verb addNamed [ null, '*' ]
npm verb lock grunt-cli# C:\Users\Kris Erickson\AppData\Roaming\npm-cache\d63f3d0b-grunt-cli.lock
npm verb request where is /grunt-cli
npm verb request registry https://registry.npmjs.org/
npm verb request id dc44ca4b260df8c3
npm verb url raw /grunt-cli
npm verb url resolving [ 'https://registry.npmjs.org/', './grunt-cli' ]
npm verb url resolved https://registry.npmjs.org/grunt-cli
npm verb request where is https://registry.npmjs.org/grunt-cli
npm info trying registry request attempt 1 at 13:36:28
npm http GET https://registry.npmjs.org/grunt-cli
/
Note: the spinner never stops (at least I have left it 10 minutes and nothing happened).
It looks like you may have installed a new npm but it is not actually being used (or did you revert back to 1.4.28?)
In either case, try following the directions here https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows for updating to the latest npm on Windows. Latest is currently 2.4.1. I recommend using Option 3.
Then try running your npm install command with maximum verbosity:
npm -ddd install -g grunt-cli
and upload your logfile as a gist https://gist.github.com either here or as a new issue at https://github.com/npm/npm/issues, and we'll help you get this sorted out.
The version number you're using doesn't comply with the semantic versionning convention npm uses: you need to specify a MAJOR.MINOR.PATCH version number.
You can either:
Use the 0.2.x notation to specify that you don't care what patch version you use, as long as the major.minor matches
Use the ~0.2.0 notation to specify that you don't care what patch version you use, as long as the major.minor matches
Read npm's documentation and semver's documentation for other possibilities...
Hope This helps.
I am running node in windows 8.1. This issue popped up on a new machine build and I searched for hours for a resolution with no success. Finally. in desperation I used fiddler in an attempt to see what calls were being made by npm AND magically the problems went away.
On further investigation I found that npm appears to require two windows environment variables to be set:
Try the following in a command prompt before running npm (Note: if you are actually behind a proxy then replace the empty quotes with your proxy address):
Setx http_proxy ""
Setx https_proxy ""

karma command not found when karma already installed

I used node.js to install karma. My first try failed when running the following command on Terminal:
npm install -g karma
That failed so I decided to use:
sudo npm install -g karma
After entering my password it seemed to install correctly.
I am pasting part of the output of the install, maybe it will mean something to someone and it will be relevant to my question. After all the npm http messages this is what I see:
> ws#0.4.27 install /usr/local/share/npm/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
SOLINK_MODULE(target) Release/bufferutil.node: Finished
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
SOLINK_MODULE(target) Release/validation.node: Finished
/usr/local/share/npm/bin/karma -> /usr/local/share/npm/lib/node_modules/karma/bin/karma
karma#0.8.6 /usr/local/share/npm/lib/node_modules/karma
├── pause#0.0.1
├── dateformat#1.0.2-1.2.3
├── xmlbuilder#0.4.2
├── colors#0.6.0-1
├── chokidar#0.6.2
├── growly#1.1.1
├── mime#1.2.9
├── q#0.9.6
├── rimraf#2.1.4 (graceful-fs#1.2.3)
├── coffee-script#1.6.3
├── minimatch#0.2.12 (sigmund#1.0.0, lru-cache#2.3.0)
├── optimist#0.3.5 (wordwrap#0.0.2)
├── glob#3.1.21 (inherits#1.0.0, graceful-fs#1.2.3)
├── LiveScript#1.0.1 (prelude-ls#1.0.1)
├── log4js#0.6.6 (dequeue#1.0.3, semver#1.1.4, async#0.1.15, readable-stream#1.0.2)
├── lodash#1.1.1
├── http-proxy#0.10.3 (pkginfo#0.2.3, utile#0.1.7)
├── istanbul#0.1.22 (abbrev#1.0.4, which#1.0.5, fileset#0.1.5, nopt#2.0.0, wordwrap#0.0.2, async#0.1.22, mkdirp#0.3.5, esprima#0.9.9, escodegen#0.0.24, handlebars#1.0.12)
└── socket.io#0.9.16 (base64id#0.1.0, policyfile#0.0.4, redis#0.7.3, socket.io-client#0.9.16)
Then when I try to run the following command to create a karma config file with this command:
karma init karma.config.js
this is the message that gets returned:
-bash: karma: command not found
I have tried the same command with sudo before it but I get the same result.
Does anyone have any idea as to what is going on?
Any help is appreciated.
*Update!
I decided to check a file named: builderror.log
located in: /usr/local/share/npm/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
This is what it shows:
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/eperez/.node-gyp/0.10.5"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/share/npm/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/.node-gyp"
gyp http GET http://nodejs.org/dist/v0.10.5/node-v0.10.5.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.5/node-v0.10.5.tar.gz
#mayankcpdixit gave the answer up there in a response to the OP's original question, but I'll put it here again in case anyone misses it.
You do not need to uninstall everything, and if I had to manually add a new path link for every npm package I try to install I'd probably shoot myself.
npm install -g karma-cli
Boom. Now you have karma command lines installed. Just like Grunt.
Edit: Please don't forget to upvote #mayankcpdixit as well, he commented directly on the original post, but didn't actually "answer" the question.
In your ~/.bash_profile (or similar) amend your PATH to include npm-installed binaries:
export PATH="$PATH:/usr/local/share/npm/bin"
I had this very same issue, and found this solution to be less time-consuming and impactful than completely re-installing node.
EDIT this has also worked for others in bash_profile
export PATH="$PATH:/usr/local/lib/node_modules/karma/bin"
It is recommended to install karma with its Command-Line-Interface (karma-cli) which will take care of fetching the appropriate karma. You can also install a different local version specific to each project you're working on and karma-cli will pick the appropriate one.
From the karma installation page:
Typing ./node_modules/karma/bin/karma start sucks so you might find it useful to install karma-cli globally:
npm install -g karma-cli
Now, check that karma was installed by typing:
karma start
You can also check that karma was installed by going to this directory:
cd /usr/local/lib/node_modules/karma
Good luck!
Don't need to completely uninstall node.js
Just
sudo rm -rf /usr/local/lib/node_modules/npm/
Then
install node.js
Then
reinstall karma
This worked for me.
I had to add export PATH="$PATH":/usr/local/lib/node_modules/npm/node_modules/karma/bin after installing karma with sudo npm install karma.
hope this helps.
Just go to test.sh:
Find: $BASE_DIR/../node_modules/karma/bin/karma start $BASE_DIR/../config/karma.conf.js $*
Replace with: /usr/local/bin/karma start $BASE_DIR/../config/karma.conf.js $*
Or: karma start $BASE_DIR/../config/karma.conf.js $*
I was also facing the same issue. It looks like karma for command line is a separate package which can be installed by
npm install -g karma-cli
When upgrading from Karma 0.10 to 0.12 the link to the karma executable is removed.
You can get it back with
cd node_modules/.bin
ln -s ../karma/bin/karma karma
Try re-installing node.js. There are lots of ways to install it, but I recommend downloading from nodejs.org
If that doesn't work, you may try to re-install karma.

Resources