npm,clojurescript , ClojureScript Node.js REPL issue

ClojureScript Node.js REPL issue


Tag: npm,clojurescript

I'm following the instructions to run ClojureScript Node.js REPL:

Everything works fine, but in the "Node.js REPL" section, I got the errors with rlwrap java -cp cljs.jar:src clojure.main node_repl.clj.

node.js> rlwrap java -cp cljs.jar:src clojure.main node_repl.clj
Exception in thread "main" Could not locate cljs/build__init.class or cljs/build.clj on classpath., compiling:(/Users/smcho/Desktop/clojurescript/node.js/node_repl.clj:2:1)
    at clojure.lang.Compiler.load(
    at clojure.main.main(
Caused by: Could not locate cljs/build__init.class or cljs/build.clj on classpath.
    at clojure.lang.RT.load(
    at clojure.lang.Compiler.load(
    ... 9 more

I found that the cljs directory is in the out directory, but the cljs does not have build.clj nor build__init.class.

enter image description here

What might be wrong?


I think the node_repl.clj has an error.

(require 'cljs.repl)
;;; (require ' ;; ERROR?
(require ' ;; <-- Replaced
(require 'cljs.repl.node) 

( "src"
  {:main 'hello-world.core
   :output-to "out/main.js"
   :verbose true})

(cljs.repl/repl (cljs.repl.node/repl-env)
  :watch "src"
  :output-dir "out")

Now everything seems to work fine.


Node JS NPM modules installed but command not recognized

Node JS and NPM was working well before. Recently I have re-installed the Node JS, NPM and the problem started. After I install a module like example npm install -g bower, the module gets installed successfully but bower -v gives 'bower' is not recognized as an internal or external command,...

Hosting my MEAN stack web app on github pages

I have a project here that is on github. I created a gh-pages branch to make it hosted on github pages. The link they gave me to my hosted site is here. I am pretty new to web apps and especially new to MEAN stack web apps. My question is...

node user model is vomitting

I am trying to get my hands dirty with making node api following this tutorial problem is that when I execute $ nodejs server.js I get this error { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version {...

Using npm to install grunt on nodeenv results in findup-sync error

After establishing a node virtualenv using nodeenv, I use source /bin/activate to switch into the correct directory, update npm, and execute npm install -g grunt or npm install -g grunt-cli and I recieve the same error: npm ERR! Linux 3.13.0-53-generic npm ERR! argv "node" "/home/{redacted-home-dir}/NodeProjects/vue/bin/npm" "install" "-g" "grunt-cli" npm ERR!...

Strange npm behavior when installing packages like grunt

I run the following command in my bash and I get the related results: [email protected]:~$ sudo npm install -g grunt-cli /usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt [email protected] /usr/local/lib/node_modules/grunt-cli ├── [email protected] ├── [email protected] ([email protected]) └── [email protected] ([email protected], [email protected]) and [email protected]:~$ grunt /usr/bin/env: node: No such file or directory I also have try to install...

How can I create a global object, and attach a string and a function to that object, in ClojureScript?

How can I create a global object, attached to the window, and attach a string and a function to that object, in ClojureScript? For example, an myobject that looks like: {"foo": function () {..}, "bar": "somestring"} => function () { .. } => "somestring"...

npm update doesn't update the package

I've run into a issue where I try to update a package on a remote server, specifically the mongoose package. If I run npm mongoose --version it will return a version number of 1.3.10. However in package.json the version specified is ^2.7.4. I've tried to run npm update and it...

How to create web client application with nodejs and npm like angularjs tutorial

I am new to nodejs, npm also angularjs. I have read and tried the angularjs tutorial project hosted on, which for me is really exciting because it shows how easy to maintain the modules with bower, testing with jasmine and karma and perform e2e with protractor using npm command,...

NPM : how to just run post-install?

Just a simple question : in my node.js project, how could I just run the postinstall script, without running install before ? FYI, this is my package.json : { "name": "gestionclientjs", ..., "dependencies": { ... }, "repository": {}, "devDependencies": { ... }, "engines": { "node": ">=0.10.0" }, "scripts": { "test":...

sass file not compiled by gulp

I want to switch from less to sass so I installed gulp-sass with npm and modified my gulpfile to compile sass instead of less (nothing else changed). Sadly gulp doesn't compile my .scss file to css and after googling and trying all i could think of it still doesn't compile....

Loop in clojure with or condition

I'm trying to write a function in clojure that calls a condition for each value in a vector; the function should return the OR of the result of the condition applied to each value. Eg I have a vector [1 2 3 4] and a condition (>= x 3) where...

How to use curly brackets in npm scripts?

I want to run this simple command in an npm script called prepare_build: ... scripts: { "prepare_build" : "mkdir -p dist/lib/{js,css}" } ... running npm run prepare_build would create a single directory dist/lib/{js,css} whereas running the command in the console would create both dist/lib/js and dist/lib/css. What am I doing...

how to integrate a lodash custom build into a project

lodash supports custom builds with only a subset of the functionality / size. Creating a custom build is a breeze with lodash-cli. What's the recommended way to take this custom build and integrate it into the project? (using npm / browserify). Do I create a custom build command that creates...

Node js Express doesn't recognize npm inside projectfolder

I'm trying to install express through cmd in windows. My problem is installing dependencies after i've successfully installed express and built a skeleton of the framework. It requires to install dependencies. It even tells me the code line cd Myprojectname && npm install But it says npm is not recognized...

VS 2015 RC - Trying to fetch local plugin from remote registry

I have a local plugin, which I'm trying to install to a Cordova project. Adding it through VS works like a charm, but when I'm building it, plugman tries to retrieve the plugin from the registry (npm http GET[Plugin]/[Version]) and the build fails, because this plugin only exist locally....

jsx command not found on mac terminal

Problem: I execute the following command from the macintosh terminal: $ jsx --watch src/ build/ I recieve the following output error from the terminal: -bash: jsx: command not found Relevant information: I am following the following tutorial: I executed the following command from the tutorial with positive output: $...

Error while updating to latest pm2

I tried updating pm2 with "npm install [email protected] -g" (Cent OS 6) but received the following error. Now, i am no longer able to use "pm2 list" (it says command not found). Your help will be highly appreciated. npm ERR! Linux 2.6.32-042stab094.8 npm ERR! argv "node" "/home/username/local/bin/npm" "install" "pm2" "-g"...

Om/Clojurescript: Issue rendering a reset application state

I am trying to display a component with om, as soon as the data needed for this widget arrives. I came up with the following (roughly): (def data (atom {})) (go (let [response (<! (http/get "../rest/ds" ))] (reset! data (:result (:body response))))) (om/root (fn [app owner] (reify om/IInitState (init-state [_]...

MongoDB : querying documents with two equal fields, $match and $eq

What is the best way to return all documents in a collection if I want document.a == document.b? I've tried db.collection.aggregate([ { $match: { $eq: [ '$a', '$b' ] } }]) But it returns with no errors or results, because I assume it is literally matching strings "$a" and "$b"....

What is the meaning of npm view dependencies output?

When executing npm view [email protected] dependencies the dependencies are not displayed uniformly. What does it mean if a dependency is marked with a single quote and green font? What does it mean if a dependency is in a white font? ...

How to serve clojurescript over flask

I have a small Flask app and I want to use some ClojureScript to enhance the user experience on the client-side. Now I have trouble serving clojurescript via flask, as the paths get mixed up. Flask asserts that static files like Javascript scripts lie in a directory static. I have...

Hot to set the title of a Windows console while npm is running?

I have started to develop a web application project on my Windows machine, for which I use npm, bower and the nodejs HTTP server. For easier start of the HTTP server, I created the batch file: @echo off title HTTP Server npm start npm start starts the http-server. For that...

Npm package upgrade notification availlable?

I wrote a node package which contains breaking changes in the next release. Does there exist a way to notify developers about that via console while upgrading via npm?

Error: EMFILE: too many open files

Using nw.js, I am just trying to save images in an array of img elements with different random names. But having a few errors, is something wrong with my code? for (i = 0; i < imgs.length; i++) { request(imgs[i].getAttribute('src')).on('error', function(err) { throw err }).pipe(fs.createWriteStream('data/imgs/' + randomString)) } imgs[] is...

Get an array of file names without extensions from a directory in Gulp?

I want to get each of the file names in 2 directories (helpers/ and dialogs/) into an array without the file extension using Gulp and/or NPM. Note that the array will be pre-populated with values - I need to append the file names to this array. In other words, my...

Cannot find a submodule imported inside a module installed from npm

I would like to use a node.js module from using browserify. I did install the module locally at my working directory. In that directory, I created a javascript file, main.jsx var React = require('react'); var ReactDatalist = require('react-datalist'); var options = ['apple','orange','pear','pineapple','melon']; React.render(<ReactDatalist list="fruit" options={options} />, document.body); Then, I...

NPM Error: self signed certificate in certificate chain

I am following the Angular 2 quick start guide and I'm stuck right at the beginning of it. My company is filtering our network connections and modifying SSL negociation. In a man in the middle style they assign a self signed certificate as the CA of the destination's certificate. Therefore...

Created a package.json file, but getting dependency errors when running npm install

I know this is a common question and I tried researching on here, but none of the answers have seemed to help me thus far. I am following this tutorial to learn node, and after I try to install the package.json I received the following errors: npm ERR! install Couldn't...

Import Record Type in Clojure/ClojureScript

Is there any way to import a record type, that works in Clojure as well as ClojureScript? As far as I can tell it's (ns x (:import y [A B])) for Clojure, (ns x (:require y :refer [A B])) for ClojureScript, and each is invalid for the respective other.

Proper npm install --save behavior?

All documentation I have seen indicates that using --save argument with npm install should update the dependencies in package.json. This does not work for me. Packages install successfully without any error in the npm console output, but `package.json' remains unchanged. What am I missing? I have seen nothing in my...

404 on api authenticate for node restful

I am using this tutorial to learn about node with restful authentication. I am getting 404s in the route when I post at this http://localhost:8090/api/authenticate Here is the response that I get Cannot POST /api/authenticate and the console shows 404 POST /api/authenticate 404 2.465 ms - 30 here is...

Node Global Install Error

I'm trying to make a Node module that, when installed with -g, will run by a single command from a terminal. All tutorials show its pretty straightforward, so I don't know what I'm missing. Here's what I've done: Package.json: ... "bin": { "myapp": "./lib/myapp.js" }, ... npm publish npm install...

Combine js files from different directories via config using grunt

I'm using grunt and sass and I'm looking for a sass-like feature to import any JS file I like to and combine them to 1 file via some config depending on the directory I am in. Example directories: startpage file1.js file2.js importjs.json page1 file3.js file4.js importjs.json global global1.js global2.js Each...

jquery appears in browserify bundle.js but not working in browser

I'm following this short tutorial on getting started with Browserify Getting Started with Browserify. Despite following everything exactly jquery isn't working on the page when bundled,ie. the button element in my app.js code below is not appended to the body. Have checked everything I can think of using chrome dev...

Node js can't require modules installed globally in OS X

I installed module by sudo npm install -g xxx in OS X, and the command echoes the module was installed in /usr/local/lib/node_modules/xxx. But the require('xxx') still fails claiming `Cannot find module 'xxx'. Only installing the module locally again by sudo npm install xxx can fix the error. Anything need to...

Node.js app giving ERR_EMPTY_RESPONSE

I'm having serious issues with an app I am building with Node.js, Express, MongoDB and Mongoose. Last night everything seemed to work when I used nodemon server.js to `run the server. On the command line everything seems to be working but on the browser (in particular Chrome) I get the...

NPM Error Parsing Json, Unexpected Token

I'm trying to install grunt, but no luck. npm install -g grunt-cli --registry gives this error: npm ERR! registry error parsing json npm ERR! Darwin 14.3.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli" "--registry" "" npm ERR! node v0.12.4 npm ERR! npm v2.10.1 npm ERR! Unexpected token <...

npm bin property is not working as expected

I wrote a simple 'addheader' node module and published it on npm. It contains a cli script which I registered in the package.json config-file in the bin property as follows: { "name" : "addheader", "bin" : "./addHeaderCli.js" } Installing the module with "npm install addheader" I can see the cli...

Is it possible to install npm package only if it has not been already installed?

Is it possible to install npm package only if it has not been already installed? I need this to speed up test on CircleCI, but when I run npm install [email protected] etc. it always downloads things and installs them from scracth, however, node_modules folder with all modules is already present...

npm install error not installing BrowserSync package

Trying to install BrowserSync I've followed the steps to install the package through the command line, installed node.js and then I went on to install npm through the command line. Now when I try to install browser-sync with the following line npm install -g browser-sync you will see it is...

return a js object from a javascript function that is called from a node cpp addon

I am tyring to create and return a javascript function object from a function that is called from a c++ node addon. The object was getting created, but wasn't getting returned by the function. callback function that creates an object named cursor var callback_fn = function(record){ var res = new...

Grunt tasks stuck in endless loop

Working on putting together a base Gruntfile.js for some upcoming projects. Starting in on a new computer so everything has been a fresh build. Installed Node and NPM using Homebrew, and then installed Grunt globally, as well as in my local directory. Here is my package.json: { "name": "timespent-prototype", "version":...

React from NPM cannot be used on the client because 'development' is not defined. The bundle was generated from Webpack

I'm creating a React Node.js app and I'm trying to generate a Webpack bundle containing the React source code I loaded from NPM. However, it seems that the React code from NPM cannot be used directly in the client. It triggers this error: Uncaught ReferenceError: development is not defined The...

Is it possible to call a ClojureScript module from a jQuery or AngularJS normal webapp?

I have an existing web UI that I would like to be able to call a function written in ClojureScript. The function would be in a separate ClojureScript module (cs_func.js file) that does not need access to the DOM. I can't find any examples on how to do this.

How to let Webpack require a root node_module instead of an child package?

I have installed backbone and backbone.babysitter trough npm. When I use backbone in my scripts like this: import Backbone from "backbone"; It loads the installed backbone version 1.2.1. This works fine until I want to use backbone.babysitter. When backbone.babysitter loads it needs to add properties to backbone itself. But the...

Error when i try to install npm with putty

here is what i get when i try to execute this command (the 3rd command - in ec2 amazon) The next step is to install NPM(Node package manager). Type the following commands: 1. git clone 2. cd npm **3. sudo make install** and here is the error i get:...

lodash npm distribution in browser

I'm using lodash in my tests, Not using webpack or browserify (don't need to). I found that the default npm build differs from what's in bower. I could of course use bower version, but I'm curious if I can use npm's instead (it's already there for Gulp). For bower I...

npm installs packages and dependencies in the project root directory

I switched from Windows to Mac. When I'm trying to install npm modules, the packages and their dependencies are created inside the project root directory. On Windows the module was installing into ./node_modules, with all dependencies inside module folder. Is there something I need to configure to make it work...

Package.json not found error when updating using npm-check-updates

I'm trying to update my node packages/modules and a lot of people (many from StackOverflow) recommended 'npm-check-updates' so I downloaded via npm and ran it. It gave me this error and I'm not sure what's wrong. Is something wrong with my PATH variable in system settings or something? I can't...

Sailsjs with angularjs npm install error

i am using sails js backend and frontend angularjs. i have given npm install. npm install package show this error: npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer [email protected] wants [email protected]~0.4.0 npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.4.0 npm ERR! peerinvalid...